Skip to content

Commit 3c8a17e

Browse files
committed
Update workflows
Removed .github/actions folder and replaced .github/workflows with that from BetterSongSearch. Recommended to do by Frozen. Keeps the project up to date with other changes to Quest Beat Saber modding.
1 parent 1669d45 commit 3c8a17e

5 files changed

Lines changed: 173 additions & 157 deletions

File tree

.github/actions/canary-ndk/action.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/build-ndk.yml

Lines changed: 0 additions & 122 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: NDK build
2+
3+
env:
4+
module_id: too-many-fireworks
5+
qmodName: TooManyFireworks
6+
cache-name: TooManyFireworks_cache
7+
8+
on:
9+
push:
10+
branches: [ main, dev ]
11+
pull_request:
12+
branches: [ main ]
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
name: Checkout
21+
with:
22+
submodules: true
23+
lfs: true
24+
25+
- uses: seanmiddleditch/gha-setup-ninja@v3
26+
27+
- name: Get QPM
28+
uses: Fernthedev/qpm-action@v1
29+
with:
30+
resolve_ndk: true
31+
#required
32+
workflow_token: ${{secrets.GITHUB_TOKEN}}
33+
restore: true # will run restore on download
34+
cache: true #will cache dependencies
35+
36+
- name: Build
37+
run: |
38+
cd ${GITHUB_WORKSPACE}
39+
pwsh -Command ./scripts/build.ps1 -release
40+
qpm qmod build
41+
42+
- name: Create Qmod
43+
run: |
44+
pwsh -Command ./scripts/createqmod.ps1 ${{env.qmodName}} -release
45+
46+
- name: Get Library Name
47+
id: libname
48+
run: |
49+
cd ./build/
50+
pattern="lib${module_id}*.so"
51+
files=( $pattern )
52+
echo "NAME=${files[0]}" >> ${GITHUB_OUTPUT}
53+
54+
- name: Upload non-debug artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ steps.libname.outputs.NAME }}
58+
path: ./build/${{ steps.libname.outputs.NAME }}
59+
if-no-files-found: error
60+
61+
- name: Upload qmod artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: ${{env.qmodName}}.qmod
65+
path: ./${{ env.qmodName }}.qmod
66+
if-no-files-found: error
67+
68+
- name: Upload debug artifact
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: debug_${{ steps.libname.outputs.NAME }}
72+
path: ./build/debug/${{ steps.libname.outputs.NAME }}
73+
if-no-files-found: error
74+
# TODO: Add auto-populating releases, auto update versions, auto publish package on release

.github/workflows/publish.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Publish release artifacts
2+
3+
env:
4+
module_id: too-many-fireworks
5+
qmodName: TooManyFireworks
6+
cache-name: TooManyFireworks_release_cache
7+
8+
on:
9+
push:
10+
tags:
11+
- "v*.*.*-bs-*.*.*"
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Get Mod and game version from tag name
22+
id: modversion
23+
run: |
24+
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
25+
TEMP=$(echo "$GITHUB_REF_NAME" | grep -Po "(?<=v)\d+.\d+.\d+")
26+
echo "VERSION=$TEMP" >> $GITHUB_ENV
27+
TEMP=$(echo "$GITHUB_REF_NAME" | grep -Po "(?<=bs-)[.\d_]*")
28+
echo "BS_VERSION=$TEMP" >> $GITHUB_ENV
29+
30+
31+
- uses: actions/checkout@v4
32+
name: Checkout
33+
with:
34+
submodules: true
35+
lfs: true
36+
37+
- uses: seanmiddleditch/gha-setup-ninja@v5
38+
39+
- name: Get QPM
40+
uses: Fernthedev/qpm-action@v1
41+
with:
42+
resolve_ndk: true
43+
#required
44+
workflow_token: ${{secrets.GITHUB_TOKEN}}
45+
restore: true # will run restore on download
46+
cache: true #will cache dependencies
47+
48+
- name: QPM Edit Version
49+
run: |
50+
qpm package edit --version "${{ env.VERSION }}"
51+
52+
- name: Build
53+
run: |
54+
cd ${GITHUB_WORKSPACE}
55+
pwsh -Command ./scripts/build.ps1 -release
56+
qpm qmod build
57+
58+
- name: Create Qmod
59+
run: |
60+
pwsh -Command ./scripts/createqmod.ps1 ${{env.qmodName}} -release
61+
62+
- name: Get Library Name and Build ID
63+
id: libname
64+
run: |
65+
cd ./build/
66+
pattern="lib${module_id}*.so"
67+
files=( $pattern )
68+
echo "LIBNAME=${files[0]}" >> $GITHUB_ENV
69+
echo "BUILD_ID=$(readelf -n ${files[0]} | grep -Po "(?<=Build ID: )[0-9a-f]+")" >> $GITHUB_ENV
70+
71+
- name: Rename debug file
72+
run: mv "./build/debug/${{ env.LIBNAME }}" "./build/debug/debug_${{ env.LIBNAME }}"
73+
74+
- name: Calculate SHA-256 of the qmod file
75+
id: qmodsha
76+
run: |
77+
echo "QMOD_SHA=$(sha256sum ./${{ env.qmodName }}.qmod | grep -Po "^[0-9a-f]+")" >> $GITHUB_ENV
78+
79+
- name: Release
80+
uses: softprops/action-gh-release@v2
81+
if: startsWith(github.ref, 'refs/tags/')
82+
with:
83+
tag_name: ${{ env.VERSION_TAG }}
84+
name: ${{ env.qmodName }} ${{ env.VERSION }} for ${{ env.BS_VERSION }}
85+
generate_release_notes: true
86+
body: |
87+
---
88+
89+
### Build info
90+
91+
SHA-256: ${{ env.QMOD_SHA }}
92+
Build ID: ${{ env.BUILD_ID }}
93+
files: |
94+
./${{ env.qmodName }}.qmod
95+
./build/${{ env.LIBNAME }}
96+
./build/debug/debug_${{ env.LIBNAME }}
97+
draft: true
98+
prerelease: false

qpm.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"pwsh ./scripts/pull-tombstone.ps1"
4141
]
4242
},
43+
"ndk": "^27.2.12479018",
4344
"qmodIncludeDirs": [
4445
"./build",
4546
"./extern/libs"

0 commit comments

Comments
 (0)