Update for 1.35.0 (Draft) (#2) #11
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 | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
module_id: chatplex-sdk-bs | |
qmodName: ChatPlexSDK-BS | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
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 | |
# get version from pushed tag | |
- name: Extract version | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: version | |
run: | | |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT} | |
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT} | |
- 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.qmodName }}.qmod | |
- name: Build & Create Qmod | |
run: | | |
cd ${GITHUB_WORKSPACE} | |
qpm s qmod | |
- name: Get Release | |
uses: octokit/[email protected] | |
id: get_release | |
with: | |
route: GET /repos/${{ github.repository }}/releases/tags/${{ steps.get_tag_version.outputs.TAG }} | |
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.qmodName }}.qmod | |
asset_name: ${{ env.qmodName }}.qmod | |
asset_content_type: application/octet-stream |