Added support of Qi focus #8
Workflow file for this run
This file contains hidden or 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: Foundry VTT Shadowrun 5 System Alpha Release Builder | |
| on: | |
| push: | |
| tags: | |
| - '**-alpha.**' | |
| permissions: | |
| contents: write | |
| jobs: | |
| sr5-system: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Export vars | |
| id: vars | |
| run: | | |
| echo "tag=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT | |
| - name: Check out repository code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Update system.json for pre-release | |
| run: | | |
| TAG="${{ steps.vars.outputs.tag }}" | |
| REPO="${{ github.repository }}" | |
| # Update version, manifest (persistent pre-release URL), and download (versioned) | |
| jq \ | |
| --arg ver "$TAG" \ | |
| --arg manifest "https://github.com/${REPO}/releases/download/pre-release/system.json" \ | |
| --arg download "https://github.com/${REPO}/releases/download/${TAG}/sr5_${TAG}.zip" \ | |
| '.version = $ver | .manifest = $manifest | .download = $download' \ | |
| system.json > system_updated.json | |
| mv system_updated.json system.json | |
| # Keep a copy for uploading as release asset | |
| cp system.json /tmp/system.json | |
| - name: Cleaning up directory | |
| run: | | |
| rm -rf less | |
| rm -rf node_modules | |
| rm -rf jsconfig.json | |
| rm -rf package*.json | |
| rm -rf gulpfile.js | |
| rm -rf MIGRATION_PLAN.md | |
| rm -rf scripts/push_to_discord | |
| mkdir sr5 | |
| shopt -s extglob | |
| mv !(sr5) sr5/ | |
| - name: Zipping system | |
| run: | | |
| zip -r sr5_${{ steps.vars.outputs.tag }}.zip sr5 | |
| - name: Create versioned GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release create "${{ steps.vars.outputs.tag }}" \ | |
| "sr5_${{ steps.vars.outputs.tag }}.zip" \ | |
| "/tmp/system.json" \ | |
| --title "[Alpha Release] ${{ steps.vars.outputs.tag }}" \ | |
| --prerelease \ | |
| --notes "This is an alpha release. Do not use for production, it is subject to big/incompatible changes." | |
| - name: Update persistent pre-release manifest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| # Create or update the persistent "pre-release" release with the latest manifest | |
| if gh release view pre-release &>/dev/null; then | |
| gh release upload pre-release \ | |
| "/tmp/system.json" \ | |
| --clobber | |
| else | |
| gh release create pre-release \ | |
| "/tmp/system.json" \ | |
| --title "Pre-release Manifest" \ | |
| --prerelease \ | |
| --notes "Persistent pre-release manifest. Install URL: https://github.com/${{ github.repository }}/releases/download/pre-release/system.json" | |
| fi | |
| - name: Post release link to Discord | |
| run: | | |
| RELEASE_URL="https://github.com/${{ github.repository }}/releases/tag/${{ steps.vars.outputs.tag }}" | |
| curl -sf -H "Content-Type: application/json" \ | |
| -d "{\"content\": \"Alpha release **${{ steps.vars.outputs.tag }}** is available: ${RELEASE_URL}\"}" \ | |
| "${{ secrets.DISCORD_ALPHA_CHANNEL_URL }}" |