Skip to content

[cargo-nextest] version 0.9.61-rc.1 #194

[cargo-nextest] version 0.9.61-rc.1

[cargo-nextest] version 0.9.61-rc.1 #194

Workflow file for this run

# 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: baptiste0928/cargo-install@2cfb0024938d23011106cbf127b393bc83fddba1 # 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@8df4de6534ceacdaed10a08f73418ca751f31793 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: baptiste0928/cargo-install@2cfb0024938d23011106cbf127b393bc83fddba1 # v1
with:
crate: cargo-release
version: =0.21.4
locked: true
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: baptiste0928/cargo-install@2cfb0024938d23011106cbf127b393bc83fddba1 # v1
with:
crate: cargo-release
version: =0.21.4
locked: true
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: baptiste0928/cargo-install@2cfb0024938d23011106cbf127b393bc83fddba1 # v1
with:
crate: cargo-release
version: =0.21.4
locked: true
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
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@8df4de6534ceacdaed10a08f73418ca751f31793 # 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.1
- 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: matrix.container == 'ghcr.io/nextest-rs/ubuntu-18.04:1.0.0'
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
# NOTE: v4 of actions/checkout uses node v20, which is typically not compatible with Ubuntu
# 18.04 but we've installed in our container by hand.
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/upload-rust-binary-action@f6b013bbda0fb47fb0e7a25a1e437b51971fb241 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: baptiste0928/cargo-install@2cfb0024938d23011106cbf127b393bc83fddba1 # 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@a1ea191d508feb8485aceba848389d49f80ca2dc # 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 }}