Skip to content

Commit 8e9cd08

Browse files
authored
Create new engine release workflow (#1950)
- Uses the new v2 build to create releases - Builds both regular and tracy builds as part of the same release - Is able to create and push a new annoted release tag * Change release auto tag and archive naming scheme
1 parent 8e453d6 commit 8e9cd08

File tree

4 files changed

+108
-17
lines changed

4 files changed

+108
-17
lines changed

.github/workflows/bar-cdn-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
release_id: context.payload.release?.id ?? context.payload.inputs.releaseId
3333
});
3434
const engines = rel.data.assets
35-
.filter((a) => a.name.endsWith('64-minimal-portable.7z'))
35+
.filter((a) => /amd64-(linux|windows)\.7z$/.test(a.name))
3636
.map((a) => a.browser_download_url)
3737
.sort();
38-
if (engines.length != 2 || !/linux/.test(engines[0]) || !/windows/.test(engines[1])) {
38+
if (engines.length != 2) {
3939
throw new Error("Not found engine archives!");
4040
}
4141

.github/workflows/engine-build.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,28 @@ on:
2020
workflow_dispatch:
2121
inputs:
2222
recache:
23-
description: "Recache ccache build objects"
23+
description: 'Recache ccache build objects'
2424
type: boolean
2525
default: false
26+
cmake-options:
27+
description: 'Custom CMake options for build'
28+
type: string
29+
split-debug-info:
30+
description: 'Split debug info'
31+
type: boolean
32+
default: true
33+
workflow_call:
34+
inputs:
35+
cmake-options:
36+
description: 'Custom CMake options for build'
37+
type: string
38+
split-debug-info:
39+
description: 'Split debug info'
40+
type: boolean
41+
default: true
42+
package-suffix:
43+
description: 'Custom suffix for the package name'
44+
type: string
2645
pull_request:
2746
paths-ignore:
2847
- 'doc/**'
@@ -94,8 +113,8 @@ jobs:
94113
BAZEL_REMOTE_S3_SECRET_ACCESS_KEY: ${{ github.event_name == 'pull_request' && vars.R2_RO_ACCESS_KEY_SECRET || secrets.R2_ACCESS_KEY_SECRET }}
95114
with:
96115
run: |
97-
if ! sha256sum --status -c <<< "8679a76074b1408a95d2b3ec0f5b1a6d0c20500cfc24c3a87ef08c1b60200f8c tools/bazel-remote"; then
98-
curl -L https://github.com/buchgr/bazel-remote/releases/download/v2.4.4/bazel-remote-2.4.4-linux-x86_64 -o bazel-remote
116+
if ! sha256sum --status -c <<< "0e3ccc67bced00bc783ee395160092c107a4699e06586a68dcd53fcfa7d8063e tools/bazel-remote"; then
117+
curl -L https://github.com/buchgr/bazel-remote/releases/download/v2.5.0/bazel-remote-2.5.0-linux-x86_64 -o bazel-remote
99118
chmod +x bazel-remote
100119
mv bazel-remote tools/bazel-remote
101120
fi
@@ -121,6 +140,7 @@ jobs:
121140
# of health checking.
122141
wait-on: |
123142
http-get://127.0.0.1:8085/cas/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
143+
wait-for: 3m
124144
- name: Pull builder image
125145
run: docker pull ghcr.io/${{ github.repository_owner }}/recoil-build-${{ matrix.system }}:latest
126146
- name: Build
@@ -141,18 +161,18 @@ jobs:
141161
bash <<EOF
142162
set -e
143163
cd /build/src/docker-build-v2/scripts
144-
./configure.sh
164+
./configure.sh ${{ inputs.cmake-options || '' }}
145165
./compile.sh
146-
./split-debug-info.sh
147-
./package.sh
166+
${{ inputs.split-debug-info == false && 'echo "Not splitting debug info."' || './split-debug-info.sh' }}
167+
./package.sh ${{ inputs.package-suffix }}
148168
149169
EOF
150-
# TODO: Switch to publickly accessible storage
151170
- name: Save
152171
if: github.event_name != 'pull_request'
153172
uses: actions/upload-artifact@v4
173+
id: save-artifact
154174
with:
155-
name: artifacts-${{ matrix.system }}
175+
name: engine-artifacts-${{ matrix.system }}-${{ inputs.package-suffix }}
156176
path: ./artifacts
157177
compression-level: 0 # already compressed
158178
- name: Unmount bazel remote overlay

.github/workflows/release-build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Create Engine Release v2
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
new-tag:
6+
description: 'Set to create a new annotated release tag, e.g. 2025.01.10.'
7+
type: string
8+
jobs:
9+
get-tag:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
outputs:
14+
tag_name: ${{ steps.release-tag.outputs.tag_name }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
filter: tree:0
19+
fetch-depth: 0
20+
- name: Create new annotated tag
21+
if: inputs.new-tag != ''
22+
env:
23+
NEW_TAG: ${{ inputs.new-tag }}
24+
run: |
25+
git config user.name "${{ github.actor }}"
26+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
27+
git tag -a -m "Version $NEW_TAG" "$NEW_TAG"
28+
git push origin tag "$NEW_TAG"
29+
- name: Get release tag
30+
id: release-tag
31+
run: |
32+
if git describe --exact-match HEAD >/dev/null 2>&1; then
33+
echo "tag_name=$(git describe --exact-match HEAD)" >> "$GITHUB_OUTPUT"
34+
else
35+
echo "tag_name=recoil{$(git rev-parse --abbrev-ref HEAD)}$(git describe --abbrev=7)" >> "$GITHUB_OUTPUT"
36+
fi
37+
build-engine:
38+
needs: get-tag
39+
uses: ./.github/workflows/engine-build.yml
40+
with:
41+
cmake-options: '-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG" -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG"'
42+
secrets: inherit
43+
build-engine-tracy:
44+
needs: get-tag
45+
uses: ./.github/workflows/engine-build.yml
46+
with:
47+
cmake-options: '-DTRACY_ENABLE=ON -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g1 -DNDEBUG -fno-omit-frame-pointer" -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g1 -DNDEBUG -fno-omit-frame-pointer"'
48+
package-suffix: '-tracy'
49+
split-debug-info: false
50+
secrets: inherit
51+
create-release:
52+
runs-on: ubuntu-latest
53+
needs: [build-engine, build-engine-tracy, get-tag]
54+
steps:
55+
- name: Download All Artifacts
56+
uses: actions/download-artifact@v4
57+
with:
58+
path: artifacts
59+
pattern: engine-artifacts-*
60+
merge-multiple: true
61+
- name: Release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
files: artifacts/*
65+
draft: true
66+
tag_name: ${{ needs.get-tag.outputs.tag_name }}

docker-build-v2/scripts/package.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@ set -e -u -o pipefail
44

55
cd /build/src
66

7-
branch=$(git rev-parse --abbrev-ref HEAD)
8-
tag_name="{$branch}$(git describe --abbrev=7)_$ENGINE_PLATFORM"
9-
bin_name=spring_bar_$tag_name-minimal-portable.7z
10-
dbg_name=spring_bar_$tag_name-minimal-symbols.tar.zst
7+
package_suffix="${1-}"
8+
base_name="recoil_$(git describe --abbrev=7)_${ENGINE_PLATFORM}"
9+
bin_name="${base_name}${package_suffix}.7z"
10+
dbg_name="${base_name}-dbgsym${package_suffix}.tar.zst"
1111

1212
cd /build/out/install
1313

1414
# Compute md5 hashes of all files in archive. We additionally gzip it as gzip adds
1515
# checksum to the list itself. To validate just `zcat files.md5.gz | md5sum -c -`
1616
find . -type f ! -name '*.dbg' ! -name files.md5.gz -exec md5sum {} \; | gzip > files.md5.gz
1717

18-
rm -f /build/artifacts/$bin_name /build/artifacts/$dbg_name
18+
rm -f "/build/artifacts/$bin_name" "/build/artifacts/$dbg_name"
1919

2020
# Trigger compression of main binaries and debug info concurrently
21-
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on /build/artifacts/$bin_name ./* -xr\!*.dbg &
22-
tar cvf - $(find ./ -name '*.dbg') | zstd -T0 > /build/artifacts/$dbg_name &
21+
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "/build/artifacts/$bin_name" ./* -xr\!*.dbg &
22+
23+
DEBUG_SYMBOLS=$(find ./ -name '*.dbg')
24+
if [[ -n $DEBUG_SYMBOLS ]]; then
25+
tar cvf - $DEBUG_SYMBOLS | zstd -T0 > "/build/artifacts/$dbg_name" &
26+
fi
27+
2328
wait

0 commit comments

Comments
 (0)