diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b24ab017..1f397226 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,14 +84,11 @@ env: # git_lfs: false - # Enabling this only helps with consecutive releases to the same version (and takes up cache storage space). - # See: . - # 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 @@ -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: @@ -174,6 +171,7 @@ jobs: needs: - get-version - bake-assets + - forward-env env: version: ${{ needs.get-version.outputs.version }} # Avoid rate-limiting. See: . @@ -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) @@ -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 @@ -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 }} @@ -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 @@ -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: . - 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