Fix qpm shared #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish release artifacts | |
env: | |
module_id: Nya | |
qmodName: Nya | |
cache-name: Nya_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 | |
# Use canary NDK to avoid lesser known compile bugs | |
- 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 ./buildQMOD.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 ./mods/${{ 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: Nya v${{ env.VERSION }} for Beat Saber ${{ env.BS_VERSION }} | |
generate_release_notes: true | |
body: | | |
### Build info | |
SHA-256: ${{ env.QMOD_SHA }} | |
Build ID: ${{ env.BUILD_ID }} | |
files: | | |
./mods/${{ env.qmodName }}.qmod | |
./build/${{ env.LIBNAME }} | |
./build/debug/debug_${{ env.LIBNAME }} | |
draft: true | |
prerelease: false |