-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2 KB
/
release.yml
File metadata and controls
56 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Release
env:
GH_USER: jonaslagoni
GH_EMAIL: <jonas-lt@live.dk>
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x' # SDK Version to use.
source-url: https://nuget.pkg.github.com/GamingAPI/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install dependencies
run: dotnet restore
- name: 'Automated Version Bump'
uses: 'jonaslagoni/gh-action-dotnet-bump@main'
id: version_bump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-tag: 'true'
skip-commit: 'true'
path-to-file: './RustGameAPI/RustGameAPI.csproj'
release-commit-message-regex: 'chore\(release\): v{{version}}'
- if: steps.version_bump.outputs.wasBumped == 'true'
run: dotnet build --configuration Release RustGameAPI
- if: steps.version_bump.outputs.wasBumped == 'true'
name: Create the package
run: dotnet pack --configuration Release RustGameAPI
- if: steps.version_bump.outputs.wasBumped == 'true'
name: Publish the package to GitHub registry
run: dotnet nuget push RustGameAPI/bin/Release/*.nupkg --api-key ${{secrets.GH_TOKEN}}
- if: steps.version_bump.outputs.wasBumped == 'true'
name: Create Pull Request with bumped version
uses: peter-evans/create-pull-request@v3
with:
token: '${{ secrets.GH_TOKEN }}'
commit-message: 'chore(release): v${{steps.version_bump.outputs.newVersion}}'
committer: '${{env.GH_USER}} ${{env.GH_EMAIL}}'
author: '${{env.GH_USER}} ${{env.GH_EMAIL}}'
title: 'chore(release): v${{steps.version_bump.outputs.newVersion}}'
body: Version bump
branch: 'version-bump/v${{steps.version_bump.outputs.newVersion}}'