-
Notifications
You must be signed in to change notification settings - Fork 31
74 lines (59 loc) · 2.34 KB
/
release.yaml
File metadata and controls
74 lines (59 loc) · 2.34 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Master Build and Release
# Controls when the action will run.
on:
workflow_dispatch:
concurrency:
group: release-${{ github.ref_name }}
env:
LATEST_TAG: latest-release
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-meson-releases:
name: Linux & macOS Release Builds
uses: ./.github/workflows/meson.yml
with:
upload_artefacts: true
build-msbuild-releases:
name: Windows Release Build
uses: ./.github/workflows/msbuild.yml
with:
upload_artefacts: true
release:
name: Publish Release
runs-on: ubuntu-latest
needs: [build-msbuild-releases, build-meson-releases]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: fetch tags
run: git fetch --tags origin
- name: Get Release Version
id: get-release-version
uses: ./.github/actions/get-game-version
- name: Bundle release assets
uses: ./.github/actions/bundle_release
- name: Create a new Release
run: |
gh release create v${{ steps.get-release-version.outputs.game-version }} \
--title "Release v${{ steps.get-release-version.outputs.game-version }}" \
--generate-notes \
--draft \
--target ${{ github.ref_name }} \
${{format('--notes-start-tag {0}', env.LATEST_TAG) || ''}} \
'CortexCommand.windows.zip#Cortex Command [v${{ steps.get-release-version.outputs.game-version }}] (Windows Release)' \
'CortexCommand.linux.zip#Cortex Command [v${{ steps.get-release-version.outputs.game-version }}] (Linux Release)' \
'CortexCommand.macos.zip#Cortex Command [v${{ steps.get-release-version.outputs.game-version }}] (macOS Release)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push Version Changes and Update latest tag
shell: bash
run: |
RELEASE_COMMIT=$(git rev-parse HEAD)
curl -X PATCH \
-H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/git/refs/tags/${{ env.LATEST_TAG }} \
-d '{
"sha": "'"$RELEASE_COMMIT"'",
"ref": "${{ github.ref }}"
}'