Push shared json #96
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 QPM Package | |
env: | |
module_id: questui | |
qmod_name: QuestUI | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout | |
with: | |
submodules: true | |
lfs: true | |
- uses: seanmiddleditch/gha-setup-ninja@v3 | |
- name: Create ndkpath.txt | |
run: | | |
echo "$ANDROID_NDK_LATEST_HOME" > ${GITHUB_WORKSPACE}/ndkpath.txt | |
cat ${GITHUB_WORKSPACE}/ndkpath.txt | |
- name: Get Tag Version | |
id: get_tag_version | |
run: | | |
echo ${GITHUB_REF#refs/tags/} | |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT} | |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT} | |
- name: Setup qpm | |
uses: Fernthedev/qpm-action@main | |
with: | |
workflow_token: ${{ secrets.GITHUB_TOKEN }} | |
restore: true | |
cache: true | |
publish: true | |
publish_token: ${{ secrets.QPM_KEY }} | |
version: ${{ steps.get_tag_version.outputs.VERSION }} | |
tag: ${{ steps.get_tag_version.outputs.TAG }} | |
qpm_release_bin: true | |
qpm_debug_bin: true | |
qpm_qmod: ${{ env.qmod_name }}.qmod | |
- name: Build | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
qpm qmod build --isLibrary=true | |
pwsh -Command ./build.ps1 | |
- name: Create Qmod | |
run: | | |
pwsh -Command ./createqmod.ps1 ${{env.qmod_name}} | |
# Get release that was created for this tag | |
- name: Get Release | |
uses: octokit/request-action@v2.x | |
id: get_release | |
with: | |
route: GET /repos/:repository/releases/tags/${{ steps.get_tag_version.outputs.TAG }} | |
repository: ${{ github.repository }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get Release Upload URL | |
id: get_upload_url | |
run: | | |
url=$(echo "$response" | jq -r '.upload_url') | |
echo $url | |
echo "upload_url=$url" >> ${GITHUB_OUTPUT} | |
env: | |
response: ${{ steps.get_release.outputs.data }} | |
- name: Get Library Name | |
id: libname | |
run: | | |
cd ./build/ | |
pattern="lib${module_id}*.so" | |
files=( $pattern ) | |
echo "NAME=${files[0]}" >> ${GITHUB_OUTPUT} | |
# Upload our release assets | |
- name: Upload Release Asset | |
id: upload_release_asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_upload_url.outputs.upload_url }} | |
asset_path: ./build/${{ steps.libname.outputs.NAME }} | |
asset_name: ${{ steps.libname.outputs.NAME }} | |
asset_content_type: application/octet-stream | |
- name: Upload Debug Asset | |
id: upload_debug_asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_upload_url.outputs.upload_url }} | |
asset_path: ./build/debug/${{ steps.libname.outputs.NAME }} | |
asset_name: debug_${{ steps.libname.outputs.NAME }} | |
asset_content_type: application/octet-stream | |
- name: Upload Qmod asset | |
id: upload_qmod_asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_upload_url.outputs.upload_url }} | |
asset_path: ./${{ env.qmod_name }}.qmod | |
asset_name: ${{ env.qmod_name }}.qmod | |
asset_content_type: application/octet-stream |