Merge pull request #72 from asacolips-projects/release/0.5.0 #16
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: Tagged Build + Release | |
| on: | |
| # pull_request: | |
| push: | |
| tags: | |
| - '*' | |
| concurrency: | |
| group: "${{ github.ref }}" | |
| cancel-in-progress: true | |
| env: | |
| AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
| AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
| FVTT_PACKAGE_TOKEN: "${{ secrets.FVTT_PACKAGE_TOKEN }}" | |
| S3_BUCKET: asacolips-artifacts | |
| REF_TYPE: ${{ github.ref_type }} | |
| REF: "${{ github.head_ref || github.ref_name}}" | |
| jobs: | |
| ##################################################################### | |
| ### Build Job ####################################################### | |
| ##################################################################### | |
| build: | |
| uses: ./.github/workflows/shared-build.yml | |
| ##################################################################### | |
| ### Deploy Job ###################################################### | |
| ##################################################################### | |
| deploy: | |
| name: Deploy | |
| needs: build | |
| runs-on: ubuntu-latest | |
| container: | |
| image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest | |
| if: github.ref_type == 'tag' && github.repository_owner == 'asacolips-projects' | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Retrieving git refs | |
| uses: actions/checkout@v4.1.0 | |
| with: | |
| fetch-depth: 50 | |
| lfs: false | |
| - name: Download artifacts from previous step | |
| uses: actions/download-artifact@v4.1.3 | |
| with: | |
| name: build | |
| - name: Get branch | |
| run: echo "BRANCH=$(./.github/workflows/get-branch.sh)" >> $GITHUB_ENV | |
| - name: S3 Upload | |
| run: | | |
| aws configure set region us-east-1 | |
| aws s3 cp ./grimwild.zip s3://${S3_BUCKET}/grimwild/${REF}/grimwild.zip --acl="public-read" | |
| aws s3 cp ./system.json s3://${S3_BUCKET}/grimwild/${REF}/system.json --acl="public-read" | |
| aws s3 cp ./system.json s3://${S3_BUCKET}/grimwild/${BRANCH}/system.json --acl="public-read" | |
| - name: Verify release notes exist | |
| id: check_files | |
| uses: andstor/file-existence-action@v3 | |
| with: | |
| files: "release-notes/${{ env.REF }}.md" | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| if: steps.check_files.outputs.files_exists == 'true' | |
| with: | |
| bodyFile: release-notes/${{ env.REF }}.md | |
| draft: false | |
| allowUpdates: true | |
| token: ${{ secrets.GITHUB_TOKEN }} # Provided by actions. | |
| ##################################################################### | |
| ### FVTT Package Manager Release Job ################################ | |
| ##################################################################### | |
| fvtt_release: | |
| name: FVTT Package Release | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| container: | |
| image: node:20 | |
| if: github.ref_type == 'tag' && github.repository_owner == 'asacolips-projects' && contains(github.ref_name, 'beta') == false && contains(github.ref_name, 'alpha') == false | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Retrieving git refs | |
| uses: actions/checkout@v4.1.0 | |
| with: | |
| fetch-depth: 50 | |
| lfs: false | |
| - name: Download artifacts from previous step | |
| uses: actions/download-artifact@v4.1.3 | |
| with: | |
| name: build | |
| - name: Retrieving cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules/ | |
| key: node-${{ hashFiles('package-lock.json') }} | |
| restore-keys: node- | |
| - name: Install NPM dependencies | |
| run: npm install | |
| - name: Create FVTT Release | |
| id: create_fvtt_release | |
| run: node ./.github/workflows/foundry-package-release.mjs --fvtt_token=${FVTT_PACKAGE_TOKEN} | |