From 723bc878a383c3526fb4df5c86ad53fb9efeb447 Mon Sep 17 00:00:00 2001 From: Daniel <790119+DanTheMan827@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:03:29 -0500 Subject: [PATCH] Update build-ndk.yml --- .github/workflows/build-ndk.yml | 50 ++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-ndk.yml b/.github/workflows/build-ndk.yml index 7aa5b2f..a578481 100644 --- a/.github/workflows/build-ndk.yml +++ b/.github/workflows/build-ndk.yml @@ -37,6 +37,9 @@ env: module_id: "bts-yeeter" qmod_name: "BTS Yeeter" +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -69,7 +72,7 @@ jobs: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT} - name: Setup qpm - uses: Fernthedev/qpm-action@main + uses: Fernthedev/qpm-action@v1 with: workflow_token: ${{ secrets.GITHUB_TOKEN }} restore: true @@ -89,13 +92,23 @@ jobs: files=( $pattern ) echo "NAME=${files[0]}" >> ${GITHUB_OUTPUT} - - name: Upload artifact + - name: Rename debug artifact + run: mv "./build/debug/${{ steps.libname.outputs.NAME }}" "./build/debug_${{ steps.libname.outputs.NAME }}" + + - name: Upload non-debug artifact uses: actions/upload-artifact@v4 with: name: ${{ steps.libname.outputs.NAME }} path: ./build/${{ steps.libname.outputs.NAME }} if-no-files-found: error + - name: Upload debug artifact + uses: actions/upload-artifact@v4 + with: + name: debug_${{ steps.libname.outputs.NAME }} + path: ./build/debug_${{ steps.libname.outputs.NAME }} + if-no-files-found: error + - name: Upload qmod artifact uses: actions/upload-artifact@v4 with: @@ -104,17 +117,40 @@ jobs: if-no-files-found: error # if we had a tag, we should make a release - - name: Upload release artifacts + - name: Upload release .qmod if: startsWith(github.ref, 'refs/tags/v') - id: upload_file_release - uses: softprops/action-gh-release@v0.1.15 + id: upload_file_qmod + uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.event.inputs.version }} - draft: true + draft: false generate_release_notes: true + files: | + ./${{ env.qmod_name }}.qmod + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload release .so artifacts + if: startsWith(github.ref, 'refs/tags/v') + id: upload_file_so + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.inputs.version }} files: | ./build/${{ steps.libname.outputs.NAME }} ./build/debug_${{ steps.libname.outputs.NAME }} - ./${{ env.qmod_name }}.qmod env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Make PR to mod repo + if: ("${{ secrets.BSQMODS_TOKEN }}" != "" && startsWith(github.ref, 'refs/tags/v')) + id: qmod-release + uses: QuestPackageManager/qmod-repo-publish-action@main + with: + token: ${{ secrets.BSQMODS_TOKEN }} + qmod_url: + ${{ + fromJSON(steps.upload_file_qmod.outputs.assets)[0].browser_download_url + }} + qmod_repo_owner: 'QuestPackageManager' + qmod_repo_name: 'bsqmods'