-
-
Notifications
You must be signed in to change notification settings - Fork 931
ci: Split the web build job in the nightly release workflow into extensions and demo+selfhosted+docs #19767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
torokati44
merged 3 commits into
ruffle-rs:master
from
torokati44:no-dual-wasm-extensions
Apr 10, 2025
Merged
ci: Split the web build job in the nightly release workflow into extensions and demo+selfhosted+docs #19767
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,7 +193,7 @@ jobs: | |
|
|
||
| build-mac-universal-binary: | ||
| name: Build macOS universal binary | ||
| needs: [create-nightly-release, build, build-web] | ||
| needs: [create-nightly-release, build, build-browser-extensions] | ||
| runs-on: macos-14 | ||
| env: | ||
| PACKAGE_FILE: ${{ needs.create-nightly-release.outputs.package_prefix }}-macos-universal.tar.gz | ||
|
|
@@ -311,8 +311,11 @@ jobs: | |
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| build-web: | ||
| name: Build web${{ matrix.demo && ' demo' || '' }} | ||
| # The first couple steps of this and the `build-web-demo-and-selfhosted` job | ||
| # (tool setup and dependency install) are identical. Hopefully in the future | ||
| # https://github.com/actions/runner/issues/1182 can help deduplicate them. | ||
| build-browser-extensions: | ||
| name: Build browser extensions | ||
| needs: create-nightly-release | ||
| if: needs.create-nightly-release.outputs.is_active == 'true' | ||
| runs-on: ubuntu-24.04 | ||
|
|
@@ -324,9 +327,6 @@ jobs: | |
| id-token: write | ||
| pull-requests: read | ||
| statuses: write | ||
| strategy: | ||
| matrix: | ||
| demo: [false, true] | ||
| steps: | ||
| - name: Clone Ruffle repo | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -362,8 +362,7 @@ jobs: | |
| - name: Install node packages | ||
| working-directory: web | ||
| shell: bash -l {0} | ||
| run: | | ||
| npm ci | ||
| run: npm ci | ||
|
|
||
| - name: Seal version data | ||
| shell: bash -l {0} | ||
|
|
@@ -377,23 +376,20 @@ jobs: | |
| - name: Build web | ||
| env: | ||
| BUILD_ID: ${{ github.run_number }} | ||
| # Build web demo with WebGPU support for testing in Chrome origin trial on ruffle.rs | ||
| CARGO_FEATURES: jpegxr${{ matrix.demo && ',webgpu' || '' }} | ||
| CARGO_FEATURES: jpegxr | ||
| FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} # Needed to inject into manifest.json | ||
| WASM_SOURCE: cargo_and_store | ||
| working-directory: web | ||
| shell: bash -l {0} | ||
| run: npm run build:repro | ||
|
|
||
| - name: Produce reproducible source archive | ||
| if: ${{ !matrix.demo }} | ||
| shell: bash -l {0} | ||
| run: | | ||
| zip -r reproducible-source.zip . -x '/web/node_modules/*' '/web/*/node_modules/*' '/web/packages/*/dist/*' '/web/docker/docker_builds/packages/*' '/target/*' '/.git/*' '/tests/tests/swfs/*' | ||
| cp reproducible-source.zip "${{ needs.create-nightly-release.outputs.package_prefix }}-reproducible-source.zip" | ||
|
|
||
| - name: Upload reproducible source archive | ||
| if: ${{ !matrix.demo }} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_REPO: ${{ github.repository }} | ||
|
|
@@ -402,36 +398,7 @@ jobs: | |
| package_file="${{ needs.create-nightly-release.outputs.package_prefix }}-reproducible-source.zip" | ||
| gh release upload "$tag_name" "$package_file" | ||
|
|
||
| - name: Build web docs | ||
| working-directory: web | ||
| run: npm run docs | ||
|
|
||
| - name: Publish npm package | ||
| if: ${{ !matrix.demo }} | ||
| # npm scoped packages are private by default, explicitly make public | ||
| run: npm publish --access public --provenance | ||
| continue-on-error: true | ||
| working-directory: web/packages/selfhosted/dist | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Package selfhosted | ||
| if: ${{ !matrix.demo }} | ||
| run: zip -r "${{ needs.create-nightly-release.outputs.package_prefix }}-web-selfhosted.zip" . | ||
| working-directory: web/packages/selfhosted/dist | ||
|
|
||
| - name: Upload selfhosted | ||
| if: ${{ !matrix.demo }} | ||
| run: | | ||
| tag_name="${{ needs.create-nightly-release.outputs.tag_name }}" | ||
| package_file="${{ needs.create-nightly-release.outputs.package_prefix }}-web-selfhosted.zip" | ||
| gh release upload "$tag_name" "$package_file" | ||
| working-directory: web/packages/selfhosted/dist | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Upload generic extension | ||
| if: ${{ !matrix.demo }} | ||
| run: | | ||
| tag_name="${{ needs.create-nightly-release.outputs.tag_name }}" | ||
| package_file="${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension.zip" | ||
|
|
@@ -442,14 +409,12 @@ jobs: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Upload Safari build artifact | ||
| if: ${{ !matrix.demo }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-safari | ||
| path: ./web/packages/extension/dist/ruffle_extension.zip | ||
|
|
||
| - name: Upload Firefox extension (unsigned) | ||
| if: ${{ !matrix.demo }} | ||
| run: | | ||
| tag_name="${{ needs.create-nightly-release.outputs.tag_name }}" | ||
| package_file="${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension-firefox-unsigned.xpi" | ||
|
|
@@ -460,7 +425,7 @@ jobs: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Publish Chrome extension | ||
| if: env.CHROME_EXTENSION_ID != '' && !matrix.demo | ||
| if: env.CHROME_EXTENSION_ID != '' | ||
| id: publish-chrome-extension | ||
| continue-on-error: true | ||
| env: | ||
|
|
@@ -474,7 +439,7 @@ jobs: | |
| file-path: ./web/packages/extension/dist/ruffle_extension.zip | ||
|
|
||
| - name: Publish Edge extension | ||
| if: env.EDGE_PRODUCT_ID != '' && !matrix.demo | ||
| if: env.EDGE_PRODUCT_ID != '' | ||
| id: publish-edge-extension | ||
| continue-on-error: true | ||
| env: | ||
|
|
@@ -486,46 +451,103 @@ jobs: | |
| client-id: ${{ secrets.EDGE_CLIENT_ID }} | ||
| api-key: ${{ secrets.EDGE_API_KEY }} | ||
|
|
||
| - name: Clone web demo | ||
| if: matrix.demo | ||
| build-web-demo-and-selfhosted: | ||
| name: Build web demo and selfhosted package with docs | ||
| needs: create-nightly-release | ||
| if: needs.create-nightly-release.outputs.is_active == 'true' | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| actions: read | ||
| attestations: write | ||
| checks: read | ||
| contents: write | ||
| id-token: write | ||
| pull-requests: read | ||
| statuses: write | ||
| steps: | ||
| - name: Clone Ruffle repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| repository: ruffle-rs/demo | ||
| path: demo | ||
| ref: master | ||
| fetch-depth: 0 | ||
| persist-credentials: false # Needed to allow commit via RUFFLE_BUILD_TOKEN below | ||
| toolchain: stable | ||
| targets: wasm32-unknown-unknown | ||
| components: rust-src | ||
|
|
||
| - name: Update web demo | ||
| if: matrix.demo | ||
| run: | | ||
| # Delete the old build. | ||
| rm -fr * | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| registry-url: https://registry.npmjs.org | ||
|
|
||
| # Copy the fresh build into this folder. | ||
| cp -fr ../web/packages/demo/dist/* . | ||
| # wasm-bindgen-cli version must match wasm-bindgen crate version. | ||
| # Be sure to update in test_web.yml, Cargo.toml, web/docker/Dockerfile, | ||
| # and web/README.md as well. | ||
| - name: Install wasm-bindgen | ||
| run: cargo install wasm-bindgen-cli --version 0.2.100 | ||
|
|
||
| # Restore our custom swfs | ||
| git restore swfs swfs.json | ||
| # Keep the version number in sync in all workflows, | ||
| # and in the extension builder Dockerfile! | ||
| - name: Install wasm-opt | ||
| uses: sigoden/install-binary@v1 | ||
| with: | ||
| repo: WebAssembly/binaryen | ||
| tag: version_123 | ||
danielhjacobs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: wasm-opt | ||
|
|
||
| # Create git commit. Amend previous commit to avoid daily commit spam. | ||
| git config user.name "RuffleBuild" | ||
| git config user.email "[email protected]" | ||
| git add -A | ||
| git commit --amend -m "Nightly build ${{ needs.create-nightly-release.outputs.date }}" | ||
| working-directory: demo | ||
| - name: Install node packages | ||
| working-directory: web | ||
| shell: bash -l {0} | ||
| run: npm ci | ||
|
|
||
| - name: Push web demo | ||
| if: github.repository == 'ruffle-rs/ruffle' && matrix.demo | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| repository: ruffle-rs/demo | ||
| github_token: ${{ secrets.RUFFLE_BUILD_TOKEN }} | ||
| directory: demo | ||
| force: true | ||
| - name: Seal version data | ||
| shell: bash -l {0} | ||
| working-directory: web | ||
| env: | ||
| BUILD_ID: ${{ github.run_number }} | ||
| ENABLE_VERSION_SEAL: "true" | ||
| FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} # Needed to inject into manifest.json | ||
| run: npm run version-seal | ||
|
|
||
| - name: Build web | ||
| env: | ||
| BUILD_ID: ${{ github.run_number }} | ||
| # NOTE: In the future, we might want to enable some features (like `webgpu`) only in | ||
| # the demo build, for limited testing (like a Chrome origin trial) on ruffle.rs. | ||
| CARGO_FEATURES: jpegxr | ||
| FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }} # Needed to inject into manifest.json | ||
| WASM_SOURCE: cargo_and_store | ||
| working-directory: web | ||
| shell: bash -l {0} | ||
| run: npm run build:repro | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. run: npm run build:dual-wasm-repro |
||
|
|
||
| - name: Build web docs | ||
| working-directory: web | ||
| run: npm run docs | ||
|
|
||
| - name: Publish npm package | ||
| # npm scoped packages are private by default, explicitly make public | ||
| run: npm publish --access public --provenance | ||
| continue-on-error: true | ||
| working-directory: web/packages/selfhosted/dist | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Package selfhosted | ||
| run: zip -r "${{ needs.create-nightly-release.outputs.package_prefix }}-web-selfhosted.zip" . | ||
| working-directory: web/packages/selfhosted/dist | ||
|
|
||
| - name: Upload selfhosted | ||
| run: | | ||
| tag_name="${{ needs.create-nightly-release.outputs.tag_name }}" | ||
| package_file="${{ needs.create-nightly-release.outputs.package_prefix }}-web-selfhosted.zip" | ||
| gh release upload "$tag_name" "$package_file" | ||
| working-directory: web/packages/selfhosted/dist | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Clone JS docs | ||
| if: ${{ !matrix.demo }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ruffle-rs/js-docs | ||
|
|
@@ -535,7 +557,6 @@ jobs: | |
| persist-credentials: false # Needed to allow commit via RUFFLE_BUILD_TOKEN below | ||
|
|
||
| - name: Update JS docs | ||
| if: ${{ !matrix.demo }} | ||
| run: | | ||
| # Delete the old docs | ||
| rm -rf master/ | ||
|
|
@@ -551,14 +572,50 @@ jobs: | |
| working-directory: js-docs | ||
|
|
||
| - name: Push JS docs | ||
| if: github.repository == 'ruffle-rs/ruffle' && !matrix.demo | ||
| if: github.repository == 'ruffle-rs/ruffle' | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| repository: ruffle-rs/js-docs | ||
| github_token: ${{ secrets.RUFFLE_BUILD_TOKEN }} | ||
| directory: js-docs | ||
| force: true | ||
|
|
||
| - name: Clone web demo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: ruffle-rs/demo | ||
| path: demo | ||
| ref: master | ||
| fetch-depth: 0 | ||
| persist-credentials: false # Needed to allow commit via RUFFLE_BUILD_TOKEN below | ||
|
|
||
| - name: Update web demo | ||
| run: | | ||
| # Delete the old build. | ||
| rm -fr * | ||
|
|
||
| # Copy the fresh build into this folder. | ||
| cp -fr ../web/packages/demo/dist/* . | ||
|
|
||
| # Restore our custom swfs | ||
| git restore swfs swfs.json | ||
|
|
||
| # Create git commit. Amend previous commit to avoid daily commit spam. | ||
| git config user.name "RuffleBuild" | ||
| git config user.email "[email protected]" | ||
| git add -A | ||
| git commit --amend -m "Nightly build ${{ needs.create-nightly-release.outputs.date }}" | ||
| working-directory: demo | ||
|
|
||
| - name: Push web demo | ||
| if: github.repository == 'ruffle-rs/ruffle' | ||
| uses: ad-m/github-push-action@master | ||
| with: | ||
| repository: ruffle-rs/demo | ||
| github_token: ${{ secrets.RUFFLE_BUILD_TOKEN }} | ||
| directory: demo | ||
| force: true | ||
|
|
||
| publish-aur-package: | ||
| name: Publish AUR package | ||
| needs: [create-nightly-release, build] | ||
|
|
||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.