-
Notifications
You must be signed in to change notification settings - Fork 6
106 lines (86 loc) · 2.81 KB
/
publish.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Publish release artifacts
env:
module_id: BetterSongSearch
qmodName: BetterSongSearch
cache-name: BSS_release_cache
on:
push:
tags:
- "v*.*.*-bs-*.*.*"
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Get Mod and game version from tag name
id: modversion
run: |
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
TEMP=$(echo "$GITHUB_REF_NAME" | grep -Po "(?<=v)\d+.\d+.\d+")
echo "VERSION=$TEMP" >> $GITHUB_ENV
TEMP=$(echo "$GITHUB_REF_NAME" | grep -Po "(?<=bs-)[.\d_]*")
echo "BS_VERSION=$TEMP" >> $GITHUB_ENV
- uses: actions/checkout@v3
name: Checkout
with:
submodules: true
lfs: true
- uses: seanmiddleditch/gha-setup-ninja@v3
- name: Setup Canary NDK
id: setup-ndk
uses: ./.github/actions/canary-ndk
- name: Create ndkpath.txt
run: |
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
cat ${GITHUB_WORKSPACE}/ndkpath.txt
- name: Get QPM
uses: Fernthedev/qpm-action@main
with:
#required
workflow_token: ${{secrets.GITHUB_TOKEN}}
restore: true # will run restore on download
cache: true #will cache dependencies
- name: QPM Edit Version
run: |
qpm package edit --version "${{ env.VERSION }}"
- name: Build
run: |
cd ${GITHUB_WORKSPACE}
pwsh -Command ./build.ps1
qpm qmod build
- name: Create Qmod
run: |
pwsh -Command ./createqmod.ps1 ${{env.qmodName}}
- name: Get Library Name and Build ID
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo "LIBNAME=${files[0]}" >> $GITHUB_ENV
echo "BUILD_ID=$(readelf -n ${files[0]} | grep -Po "(?<=Build ID: )[0-9a-f]+")" >> $GITHUB_ENV
- name: Rename debug file
run: mv "./build/debug/${{ env.LIBNAME }}" "./build/debug/debug_${{ env.LIBNAME }}"
- name: Calculate SHA-256 of the qmod file
id: qmodsha
run: |
echo "QMOD_SHA=$(sha256sum ./${{ env.qmodName }}.qmod | grep -Po "^[0-9a-f]+")" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ env.VERSION_TAG }}
name: BetterSongSearch ${{ env.VERSION }} for ${{ env.BS_VERSION }}
generate_release_notes: true
body: |
---
### Build info
SHA-256: ${{ env.QMOD_SHA }}
Build ID: ${{ env.BUILD_ID }}
files: |
./${{ env.qmodName }}.qmod
./build/${{ env.LIBNAME }}
./build/debug/debug_${{ env.LIBNAME }}
draft: true
prerelease: false