Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 11 additions & 36 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,11 @@ env:
# <https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage>
git_lfs: false

# Enabling this only helps with consecutive releases to the same version (and takes up cache storage space).
# See: <https://github.com/orgs/community/discussions/27059>.
# This is most useful in combination with `continuous_deployment_to_itch`
use_github_cache: true

# Whether to deploy the newest version of the app on every push to `main` to itch.io. Requires `itch_page` to be set.
# Whether to deploy the newest version of the app on every push to `main` to web targets.
# Will upload to GitHub pages and / or to itch.io if they have been configured.
# Will ignore warnings.
continuous_deployment_to_itch: true
# Warning: If you use private repositories, this will eat through your available worker minutes quickly.
continuous_deployment_to_web: true

# Need to use nightly for stutterless audio on Wasm. For simplicity, use the same toolchain across all build targets
toolchain: nightly-2026-01-22
Expand All @@ -107,7 +104,7 @@ jobs:
run: "true"
outputs:
itch_page: ${{ env.itch_page }}
continuous_deployment_to_itch: ${{ env.continuous_deployment_to_itch }}
continuous_deployment_to_web: ${{ env.continuous_deployment_to_web }}

# Determine the version number for this workflow.
get-version:
Expand Down Expand Up @@ -174,6 +171,7 @@ jobs:
needs:
- get-version
- bake-assets
- forward-env
env:
version: ${{ needs.get-version.outputs.version }}
# Avoid rate-limiting. See: <https://github.com/cargo-bins/cargo-binstall/issues/2045>.
Expand Down Expand Up @@ -232,7 +230,7 @@ jobs:

# Check if building for this platform is enabled.
echo 'is_platform_enabled=${{
(matrix.platform == 'web' && (inputs.build_for_web || (github.event_name == 'push' && env.continuous_deployment_to_itch == 'true'))) ||
(matrix.platform == 'web' && (inputs.build_for_web || (github.event_name == 'push' && env.continuous_deployment_to_web == 'true'))) ||
(matrix.platform == 'linux' && inputs.build_for_linux) ||
(matrix.platform == 'windows' && inputs.build_for_windows) ||
(matrix.platform == 'macos' && inputs.build_for_macos)
Expand Down Expand Up @@ -264,7 +262,7 @@ jobs:
toolchain: ${{ env.toolchain }}

- name: Restore Rust cache
if: ${{ env.is_platform_enabled == 'true' && env.use_github_cache == 'true' }}
if: ${{ env.is_platform_enabled == 'true' && needs.forward-env.outputs.continuous_deployment_to_web == 'true' }}
uses: Swatinem/rust-cache@v2
with:
shared-key: release
Expand Down Expand Up @@ -375,7 +373,7 @@ jobs:
retention-days: 1

- name: Upload web bundle to workflow artifacts for GitHub Pages (Web)
if: ${{ env.is_platform_enabled == 'true' && matrix.platform == 'web' && inputs.deploy_to_github_pages }}
if: ${{ env.is_platform_enabled == 'true' && matrix.platform == 'web' && (inputs.deploy_to_github_pages == 'true' || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_web== 'true')) }}
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.app }}/${{ env.cargo_build_binary_name }}
Expand All @@ -394,11 +392,8 @@ jobs:
# Deploy to itch.io.
deploy-to-itch:
runs-on: ubuntu-latest
needs:
- forward-env
- get-version
- build
if: ${{ (inputs.deploy_to_itch || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_itch == 'true')) && needs.forward-env.outputs.itch_page != '' }}
needs: build
if: ${{ (inputs.deploy_to_itch || (github.event_name == 'push' && needs.forward-env.outputs.continuous_deployment_to_web == 'true')) && needs.forward-env.outputs.itch_page != '' }}

steps:
- name: Download packages
Expand All @@ -425,23 +420,3 @@ jobs:
tmp/"${package}"/* \
'${{ env.itch_page }}':"${package#package-}"
done

# Deploy to GitHub Pages.
deploy-to-github-pages:
runs-on: ubuntu-latest
needs: build
permissions:
# Required to deploy to GitHub Pages.
pages: write
# Required for GitHub Pages to verify the source of the deployment.
# See: <https://github.com/actions/deploy-pages/issues/329>.
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
if: ${{ inputs.deploy_to_github_pages && inputs.build_for_web }}

steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4
Loading