Merge pull request #15 from RedBrumbler/dev/paperlog #27
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: config-utils_test | |
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: QPM Action | |
uses: Fernthedev/qpm-action@main | |
with: | |
workflow_token: ${{ secrets.GITHUB_TOKEN }} | |
restore: true | |
cache: true | |
version: ${{ steps.get_tag_version.outputs.VERSION }} | |
publish: false # don't publish here in case the build fails | |
- name: List Post Restore | |
run: | | |
echo includes: | |
ls -la ${GITHUB_WORKSPACE}/extern/includes | |
echo libs: | |
ls -la ${GITHUB_WORKSPACE}/extern/libs | |
- name: Build | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
pwsh -Command ./build.ps1 | |
# Publish the package; this also modifies and commits the qpm.json/qpm.shared.json with the asset links | |
- name: QPM Publish | |
uses: Fernthedev/qpm-action@main | |
with: | |
workflow_token: ${{ secrets.GITHUB_TOKEN }} | |
restore: false | |
eager_publish: true # Will publish the package | |
publish_token: ${{ secrets.QPM_PUBLISH_KEY }} # Token required for authorization publish to qpackages.com | |
version: ${{ steps.get_tag_version.outputs.VERSION }} | |
tag: ${{ steps.get_tag_version.outputs.TAG }} | |
# set to true if applicable, ASSUMES the file is already a release asset | |
qpm_release_bin: true | |
qpm_debug_bin: false | |
# 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 |