build(deps): bump actions/checkout from 4 to 6 #28
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: Build typst-package-check | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: The branch, tag or SHA in https://github.com/typst/package-check. | |
| default: main | |
| type: string | |
| release: | |
| description: Whether to publish artifacts in a new release. | |
| default: false | |
| type: boolean | |
| pull_request: | |
| paths: | |
| - .github/workflows/package-check.yaml | |
| # The following lines are based on GitHub docs, because typst/package-check uses nix and docker. | |
| # https://docs.github.com/en/actions/tutorials/build-and-test-code/rust | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| INPUT_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || 'main' }} | |
| INPUT_RELEASE: ${{ github.event_name == 'workflow_dispatch' && inputs.release || false }} | |
| # We pin xwin to 16 for now, because as of 2026-01, the default xwin 17 can't compile cxx 1.0.194, which is required by typst-package-check through wasm-opt(build). | |
| # https://github.com/typst-community/dev-builds/issues/4 | |
| XWIN_VERSION: ${{ matrix.cargo == 'cargo xwin' && '16' || '' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| cargo: cross | |
| - target: x86_64-pc-windows-msvc | |
| cargo: cargo xwin | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: typst/package-check | |
| ref: ${{ env.INPUT_REF }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: dev-builds | |
| - name: Report the revision | |
| shell: bash | |
| id: report | |
| run: | | |
| set -euxo pipefail | |
| revision=$(python dev-builds/scripts/get_revision.py) | |
| echo "Revision: $revision" | |
| echo "revision=$revision" >> "$GITHUB_OUTPUT" | |
| echo "Revision: \`$revision\`." >> "$GITHUB_STEP_SUMMARY" | |
| - run: rustup target add ${{ matrix.target }} | |
| - name: Cache cargo xwin | |
| if: ${{ matrix.cargo == 'cargo xwin' }} | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/cargo-xwin | |
| key: | | |
| ${{ runner.os }}-cargo-xwin-${{ env.XWIN_VERSION }}-${{ matrix.target }} | |
| - name: Setup cargo xwin | |
| if: ${{ matrix.cargo == 'cargo xwin' }} | |
| run: | | |
| rustup component add llvm-tools | |
| pip install cargo-xwin | |
| - name: Setup cross | |
| if: ${{ matrix.cargo == 'cross' }} | |
| run: | | |
| curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash | |
| cargo binstall cross --force # Even if cached, reinstall to set PATH properly. | |
| - name: Vendor openssl for musl | |
| if: ${{ endsWith(matrix.target, '-musl') }} | |
| run: | | |
| cat <<EOF >> Cargo.toml | |
| openssl = { version = "^0.10", features = ["vendored"] } | |
| EOF | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ matrix.target }}-typst-package-check-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ matrix.target }}-typst-package-check | |
| ${{ runner.os }}-cargo-${{ matrix.target }} | |
| - name: Build | |
| run: | | |
| ${{ matrix.cargo }} build --release --target ${{ matrix.target }} | |
| - name: Prepare to upload | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| directory=typst-package-check-${{ matrix.target }} | |
| mkdir $directory | |
| cp README.md LICENSE* $directory | |
| if [ -f target/${{ matrix.target }}/release/typst-package-check.exe ]; then | |
| cp target/${{ matrix.target }}/release/typst-package-check.exe $directory | |
| 7z a -r $directory.zip $directory | |
| else | |
| cp target/${{ matrix.target }}/release/typst-package-check $directory | |
| tar cJf $directory.tar.xz $directory | |
| fi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: typst-package-check-${{ matrix.target }} | |
| path: "typst-package-check-${{ matrix.target }}.*" | |
| - uses: softprops/action-gh-release@v2 | |
| if: ${{ env.INPUT_RELEASE == 'true' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.report.outputs.revision }} | |
| name: ${{ steps.report.outputs.revision }} | |
| draft: true | |
| prerelease: false # can be edited in the Web UI | |
| files: | | |
| typst-package-check-${{ matrix.target }}.* | |
| - name: Report the release | |
| if: ${{ env.INPUT_RELEASE == 'true' }} | |
| run: | | |
| echo "Please publish the [draft release](https://github.com/typst-community/dev-builds/releases)." >> "$GITHUB_STEP_SUMMARY" |