-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 2.11 KB
/
release.yml
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
57
58
name: Release
on:
repository_dispatch:
types: [ build-complete ]
jobs:
release:
runs-on: ubuntu-latest
outputs:
nextVersion: ${{ steps.nextVersion.outputs.nextVersion }}
nextTag: ${{ steps.nextVersion.outputs.nextTag }}
commitish: ${{ steps.commit.outputs.commitish }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: nextVersion
run: |
sudo apt-get install xmlstarlet
cd src/WPCEmu
VERSION=$(npx semver -i prerelease $(xmlstarlet sel -t -v "//Project/PropertyGroup/PackageVersion" WPCEmu.csproj))
xmlstarlet ed -L -u "//Project/PropertyGroup/PackageVersion" -v $VERSION WPCEmu.csproj
echo ::set-output name=nextVersion::${VERSION}
echo ::set-output name=nextTag::"v${VERSION}"
- name: Commit
id: commit
run: |
git config user.name "github-actions"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add src/WPCEmu/WPCEmu.csproj
git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}."
git push
commitish=$(git rev-parse HEAD)
echo ::set-output name=commitish::${commitish}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.nextVersion.outputs.nextTag }}
release_name: ${{ steps.nextVersion.outputs.nextTag }}
prerelease: true
commitish: ${{ steps.commit.outputs.commitish }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dispatch:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_PAT }}
event-type: release-complete
client-payload: '{ "run_id": "${{ github.run_id }}",
"nextVersion": "${{ needs.release.outputs.nextVersion }}",
"nextTag": "${{ needs.release.outputs.nextTag }}",
"commitish": "${{ needs.release.outputs.commitish }}" }'