[cargo-nextest] version 0.9.107 #49
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
| # adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml | |
| name: Publish test releases to GitHub | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| internal-test-release: | |
| if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'internal-test-') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| persist-credentials: false | |
| # Note: do not publish this until binaries are built and uploaded below. This is so that | |
| # `cargo binstall` keeps working. | |
| - uses: taiki-e/create-gh-release-action@26b80501670402f1999aff4b934e1574ef2d3705 # v1 | |
| id: create-gh-release | |
| with: | |
| prefix: internal-test | |
| title: $prefix $version | |
| branch: main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| outputs: | |
| version: ${{ steps.create-gh-release.outputs.version }} | |
| build-internal-test-binaries: | |
| name: Build internal-test binaries for ${{ matrix.target }} | |
| if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'internal-test-') | |
| needs: | |
| - internal-test-release | |
| strategy: | |
| matrix: | |
| include: | |
| # Native builds | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| build-target: x86_64-pc-windows-msvc | |
| build-tool: cargo | |
| dry-run: true | |
| - target: i686-pc-windows-msvc | |
| os: windows-latest | |
| build-target: i686-pc-windows-msvc | |
| build-tool: cargo | |
| dry-run: true | |
| - target: aarch64-pc-windows-msvc | |
| os: windows-latest | |
| build-target: aarch64-pc-windows-msvc | |
| build-tool: cargo | |
| dry-run: true | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - uses: taiki-e/upload-rust-binary-action@3962470d6e7f1993108411bc3f75a135ec67fc8c # v1.27.0 | |
| with: | |
| bin: internal-test | |
| # The tag name contains the binary name so just use that. | |
| archive: $tag-$target | |
| build-tool: ${{ matrix.build-tool }} | |
| target: ${{ matrix.build-target }} | |
| tar: all | |
| zip: windows | |
| checksum: b2,sha256 | |
| # dry-run to not upload the binary to the GitHub release | |
| dry-run: ${{ matrix.dry-run }} | |
| dry-run-intended: ${{ matrix.dry-run }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CARGO_PROFILE_RELEASE_LTO: true | |
| CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1 | |
| - name: Download verpatch on Windows | |
| if: endsWith(matrix.target, '-pc-windows-msvc') | |
| shell: bash | |
| run: | | |
| set -x | |
| mkdir -p target/unsigned | |
| cd target/unsigned | |
| cp ../${{ matrix.build-target }}/release/internal-test.exe . | |
| curl -LsSfO "https://github.com/nextest-rs/mukti/releases/download/verpatch-1.0.10/verpatch-bin-1.0.10.zip" | |
| unzip verpatch-bin-1.0.10.zip | |
| - name: Add metadata to Windows binary | |
| if: endsWith(matrix.target, '-pc-windows-msvc') | |
| shell: powershell | |
| run: | | |
| cd target/unsigned | |
| # Extract version from ref_name, e.g. internal-test-0.9.97 -> 0.9.97 | |
| $refName = "${{ github.ref_name }}" | |
| if ($refName -match "^internal-test-(.+)$") { | |
| $version = $Matches[1] | |
| } else { | |
| Write-Error "Could not extract version from ref_name: $refName" | |
| exit 1 | |
| } | |
| .\verpatch.exe /va .\internal-test.exe ` | |
| $version /high ` | |
| /pv $version ` | |
| /s product "internal-test" ` | |
| /s "(c)" "(c) The nextest Contributors. License: MIT OR Apache-2.0" | |
| - name: Upload unsigned Windows artifact | |
| id: upload-unsigned-artifact | |
| if: endsWith(matrix.target, '-pc-windows-msvc') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }}-unsigned | |
| path: target/unsigned/internal-test.exe | |
| - run: mkdir -p target/signed | |
| - name: Submit signing request | |
| id: submit-signing-request | |
| if: endsWith(matrix.target, '-pc-windows-msvc') | |
| uses: signpath/github-action-submit-signing-request@ced31329c0317e779dad2eec2a7c3bb46ea1343e # v1.3 | |
| with: | |
| api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' | |
| organization-id: '34634019-2ee0-4162-830a-72cd1a0cb73f' | |
| project-slug: 'nextest' | |
| signing-policy-slug: 'test-signing' | |
| artifact-configuration-slug: 'internal-test' | |
| github-artifact-id: '${{ steps.upload-unsigned-artifact.outputs.artifact-id }}' | |
| wait-for-completion: true | |
| output-artifact-directory: 'target/signed' | |
| - name: Archive and upload Windows artifacts | |
| id: archive-windows-artifact | |
| if: endsWith(matrix.target, '-pc-windows-msvc') | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -x | |
| cd target/signed | |
| tar -czf ${{ github.ref_name }}-${{ matrix.target }}.tar.gz internal-test.exe | |
| # Windows has 7z, not zip. | |
| 7z a ${{ github.ref_name }}-${{ matrix.target }}.zip internal-test.exe | |
| sha256sum --binary \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.tar.gz \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.zip \ | |
| > ${{ github.ref_name }}-${{ matrix.target }}.sha256 | |
| b2sum --binary \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.tar.gz \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.zip \ | |
| > ${{ github.ref_name }}-${{ matrix.target }}.b2 | |
| gh release upload ${{ github.ref_name }} \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.tar.gz \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.zip \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.sha256 \ | |
| ${{ github.ref_name }}-${{ matrix.target }}.b2 | |
| - name: Set archive output variable | |
| id: archive-output | |
| shell: bash | |
| run: | | |
| if [[ ${{ matrix.target }} == *-pc-windows-msvc ]]; then | |
| echo "${{ matrix.target }}-tar=${{ github.ref_name }}-${{ matrix.target }}".tar.gz >> $GITHUB_OUTPUT | |
| echo "${{ matrix.target }}-zip=${{ github.ref_name }}-${{ matrix.target }}".zip >> $GITHUB_OUTPUT | |
| else | |
| echo "${{ matrix.target }}-tar=${{ github.ref_name }}-${{ matrix.target }}".tar.gz >> $GITHUB_OUTPUT | |
| fi | |
| outputs: | |
| x86_64-windows-tar: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-tar }} | |
| x86_64-windows-zip: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-zip }} | |
| i686-windows-tar: ${{ steps.archive-output.outputs.i686-pc-windows-msvc-tar }} | |
| i686-windows-zip: ${{ steps.archive-output.outputs.i686-pc-windows-msvc-zip }} | |
| aarch64-windows-tar: ${{ steps.archive-output.outputs.aarch64-pc-windows-msvc-tar }} | |
| aarch64-windows-zip: ${{ steps.archive-output.outputs.aarch64-pc-windows-msvc-zip }} |