chore: add publishing cover (#9) #43
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: Release Packaging | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
check: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v1 | |
- name: Load dotenv | |
run: just ci-load-dotenv | |
- name: Check | |
run: just fmt | |
- name: Ensure version is equal to tag | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
[ "${{ env.game_version }}" == "${{ env.BRANCH_NAME }}" ] || exit 2 | |
build: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: [check] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v1 | |
- name: Load dotenv | |
run: just ci-load-dotenv | |
- name: Cache Godot | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.mkflower/bin | |
~/.local/share/godot/export_templates | |
key: ${{ env.godot_version }} | |
- name: Export | |
run: just export | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.game_name }}-v${{ env.game_version }} | |
path: dist/* | |
retention-days: 1 | |
deploy: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: [check] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v1 | |
- name: Cache Godot | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.mkflower/bin | |
~/.local/share/godot/export_templates | |
key: ${{ env.godot_version }} | |
- name: Load dotenv | |
run: just ci-load-dotenv | |
- name: Export | |
run: just export-web | |
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail. | |
- name: Install rsync | |
run: | | |
sudo apt-get update && sudo apt-get install -y rsync | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
folder: build/web | |
publish: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: [build] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v1 | |
- name: Load dotenv | |
run: just ci-load-dotenv | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
workflow: ${{ github.event.workflow_run.workflow_id }} | |
name: ${{ env.game_name }}-v${{ env.game_version }} | |
path: dist/ | |
skip_unpack: false | |
- name: Publish | |
run: just ci-publish | |
env: | |
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |