Skip to content

Commit

Permalink
Update build-ndk.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTheMan827 authored Jul 24, 2024
1 parent a57d542 commit 723bc87
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/build-ndk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ env:
module_id: "bts-yeeter"
qmod_name: "BTS Yeeter"

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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'

0 comments on commit 723bc87

Please sign in to comment.