[cargo-nextest] version 0.9.58-rc.3 #185
Workflow file for this run
This file contains 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 releases to GitHub | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
quick-junit-release: | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'quick-junit-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: baptiste0928/cargo-install@v1 | |
with: | |
crate: cargo-release | |
# Version 0.21.4 has the idempotency behavior we want, until | |
# https://github.com/crate-ci/cargo-release/issues/594 is addressed. | |
version: =0.21.4 | |
locked: true | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
prefix: quick-junit | |
changelog: quick-junit/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh --exclude cargo-nextest | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
nextest-filtering-release: | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'nextest-filtering-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: baptiste0928/cargo-install@v1 | |
with: | |
crate: cargo-release | |
version: =0.21.4 | |
locked: true | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
prefix: nextest-filtering | |
changelog: nextest-filtering/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh --exclude cargo-nextest | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
nextest-metadata-release: | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'nextest-metadata-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: baptiste0928/cargo-install@v1 | |
with: | |
crate: cargo-release | |
version: =0.21.4 | |
locked: true | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
prefix: nextest-metadata | |
changelog: nextest-metadata/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh --exclude cargo-nextest | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
nextest-runner-release: | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'nextest-runner-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: baptiste0928/cargo-install@v1 | |
with: | |
crate: cargo-release | |
version: =0.21.4 | |
locked: true | |
- uses: taiki-e/create-gh-release-action@v1 | |
with: | |
prefix: nextest-runner | |
changelog: nextest-runner/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh --exclude cargo-nextest | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
cargo-nextest-release: | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'cargo-nextest-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
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@v1 | |
id: create-gh-release | |
with: | |
prefix: cargo-nextest | |
# The changelog for cargo-nextest is hosted on the website | |
changelog: site/src/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
version: ${{ steps.create-gh-release.outputs.version }} | |
build-cargo-nextest-binaries: | |
name: Build cargo-nextest binaries for ${{ matrix.target }} | |
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'cargo-nextest-') | |
needs: | |
- cargo-nextest-release | |
strategy: | |
matrix: | |
include: | |
# Native builds | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-22.04 | |
container: ghcr.io/nextest-rs/ubuntu-18.04:1.0.0 | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
container: | |
- target: i686-pc-windows-msvc | |
os: windows-latest | |
container: | |
- target: universal-apple-darwin | |
os: macos-latest | |
container: | |
# Builds using cross | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-22.04 | |
# musl is statically linked and uses cross | |
container: | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-22.04 | |
# uses cross | |
container: | |
- target: x86_64-unknown-freebsd | |
os: ubuntu-22.04 | |
# uses cross | |
container: | |
- target: x86_64-unknown-illumos | |
os: ubuntu-22.04 | |
# uses cross | |
container: | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
steps: | |
- if: contains(matrix.container, 'ubuntu-18.04') | |
run: | | |
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/upload-rust-binary-action@v1 | |
with: | |
bin: cargo-nextest | |
# The tag name contains the binary name so just use that. | |
archive: $tag-$target | |
target: ${{ matrix.target }} | |
tar: all | |
zip: windows | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_PROFILE_RELEASE_LTO: true | |
- name: Set archive output variable | |
id: archive-output | |
shell: bash | |
run: | | |
if [[ ${{ matrix.target }} == "x86_64-pc-windows-msvc" || ${{ matrix.target }} == "i686-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-linux-tar: ${{ steps.archive-output.outputs.x86_64-unknown-linux-gnu-tar }} | |
x86_64-linux-musl-tar: ${{ steps.archive-output.outputs.x86_64-unknown-linux-musl-tar }} | |
aarch64-linux-tar: ${{ steps.archive-output.outputs.aarch64-unknown-linux-gnu-tar }} | |
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 }} | |
mac-tar: ${{ steps.archive-output.outputs.universal-apple-darwin-tar }} | |
x86_64-unknown-freebsd-tar: ${{ steps.archive-output.outputs.x86_64-unknown-freebsd-tar }} | |
x86_64-unknown-illumos-tar: ${{ steps.archive-output.outputs.x86_64-unknown-illumos-tar }} | |
update-release-meta: | |
name: Update release-meta branch and publish to crates.io | |
if: github.repository_owner == 'nextest-rs' | |
needs: | |
- cargo-nextest-release | |
- build-cargo-nextest-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: baptiste0928/cargo-install@v1 | |
with: | |
crate: cargo-release | |
version: =0.21.4 | |
locked: true | |
- name: Download mukti | |
run: | | |
mkdir -p ~/bin | |
curl -LsSf "https://github.com/nextest-rs/mukti/releases/download/mukti-bin-0.6.0/mukti-bin-0.6.0-x86_64-unknown-linux-gnu.tar.gz" \ | |
| tar xzf - -C ~/bin | |
- name: Add release metadata | |
run: | | |
~/bin/mukti-bin add-release --version ${{ needs.cargo-nextest-release.outputs.version }} \ | |
--release-url "https://github.com/nextest-rs/nextest/releases/${{ github.ref_name }}" \ | |
--archive-prefix "https://github.com/nextest-rs/nextest/releases/download/${{ github.ref_name }}" \ | |
--archive x86_64-unknown-linux-gnu:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-linux-tar }} \ | |
--archive x86_64-unknown-linux-musl:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-linux-musl-tar }} \ | |
--archive aarch64-unknown-linux-gnu:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.aarch64-linux-tar }} \ | |
--archive x86_64-pc-windows-msvc:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-windows-tar }} \ | |
--archive x86_64-pc-windows-msvc:zip=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-windows-zip }} \ | |
--archive i686-pc-windows-msvc:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.i686-windows-tar }} \ | |
--archive i686-pc-windows-msvc:zip=${{ needs.build-cargo-nextest-binaries.outputs.i686-windows-zip }} \ | |
--archive universal-apple-darwin:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.mac-tar }} \ | |
--archive x86_64-unknown-freebsd:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-unknown-freebsd-tar }} \ | |
--archive x86_64-unknown-illumos:tar.gz=${{ needs.build-cargo-nextest-binaries.outputs.x86_64-unknown-illumos-tar }} \ | |
- name: Generate netlify redirects | |
run: | | |
mkdir out-dir | |
~/bin/mukti-bin generate-netlify out-dir \ | |
--alias linux=x86_64-unknown-linux-gnu:tar.gz \ | |
--alias linux-musl=x86_64-unknown-linux-musl:tar.gz \ | |
--alias linux-arm=aarch64-unknown-linux-gnu:tar.gz \ | |
--alias windows=x86_64-pc-windows-msvc:zip \ | |
--alias windows-tar=x86_64-pc-windows-msvc:tar.gz \ | |
--alias windows-x86=i686-pc-windows-msvc:zip \ | |
--alias windows-x86-tar=i686-pc-windows-msvc:tar.gz \ | |
--alias mac=universal-apple-darwin:tar.gz \ | |
--alias freebsd=x86_64-unknown-freebsd:tar.gz \ | |
--alias illumos=x86_64-unknown-illumos:tar.gz \ | |
- name: Update releases.json on main branch | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions" | |
git pull --autostash --rebase origin main | |
git add .releases.json | |
git commit -m "Update release metadata for ${{ github.ref_name }}" | |
git push origin HEAD:main | |
- name: Copy releases.json to output dir | |
run: | | |
cp .releases.json out-dir/releases.json | |
- name: Copy static files to output dir | |
# Note trailing slash after release-meta-static is important | |
run: | | |
rsync -avH site/release-meta-static/ out-dir | |
- name: Deploy release metadata | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: release-meta | |
folder: out-dir | |
# cargo release requires the working dir to not have any untracked files, hence the git clean. | |
- run: | | |
git clean -fdx | |
./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |