Skip to content

[nextest-filtering] version 0.12.0 #253

[nextest-filtering] version 0.12.0

[nextest-filtering] version 0.12.0 #253

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:
nextest-filtering-release:
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'nextest-filtering-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: taiki-e/install-action@0b73cec6bfb20724b64cae80024f8fa52195c902 # v2
with:
tool: [email protected]
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: taiki-e/install-action@0b73cec6bfb20724b64cae80024f8fa52195c902 # v2
with:
tool: [email protected]
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: taiki-e/install-action@0b73cec6bfb20724b64cae80024f8fa52195c902 # v2
with:
tool: [email protected]
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # 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@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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
# On Linux, we use glibc 2.27, as the minimum of
# - Ubuntu 18.04 (glibc 2.27)
# - CentOS 8 (glibc 2.28)
# - Debian 10 (glibc 2.28)
#
# See https://repology.org/project/glibc/versions.
#
# We used to use an Ubuntu 18.04 container, but that became untenable over time:
# https://github.com/nextest-rs/nextest/issues/1055
build-target: x86_64-unknown-linux-gnu.2.27
build-tool: cargo-zigbuild
- target: x86_64-pc-windows-msvc
os: windows-latest
build-target: x86_64-pc-windows-msvc
build-tool: cargo
- target: i686-pc-windows-msvc
os: windows-latest
build-target: i686-pc-windows-msvc
build-tool: cargo
- target: universal-apple-darwin
# macos-14 for M1 runners
os: macos-14
build-target: universal-apple-darwin
build-tool: cargo
# Builds using cross
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
build-target: x86_64-unknown-linux-musl
# musl is statically linked and uses cross
build-tool: cross
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
build-target: aarch64-unknown-linux-gnu
build-tool: cross
- target: x86_64-unknown-freebsd
os: ubuntu-22.04
build-target: x86_64-unknown-freebsd
build-tool: cross
- target: x86_64-unknown-illumos
os: ubuntu-22.04
build-target: x86_64-unknown-illumos
build-tool: cross
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/upload-rust-binary-action@3bbb07bb7f438d0fdf6ce5118bdf9e6e21c0b2a5 # v1.22.0
with:
bin: cargo-nextest
# 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_PROFILE_RELEASE_LTO: true
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
- 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:
- name: Clone nextest repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
path: nextest
- name: Clone release-meta repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
repository: nextest-rs/release-meta
ref: main
token: ${{ secrets.RELEASE_META_DEPLOY_TOKEN }}
path: release-meta
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo release
uses: taiki-e/install-action@0b73cec6bfb20724b64cae80024f8fa52195c902 # v2
with:
tool: [email protected]
- name: Download mukti
run: |
mkdir -p ~/bin
curl -LsSf "https://github.com/nextest-rs/mukti/releases/download/mukti-bin-0.7.4/mukti-bin-0.7.4-x86_64-unknown-linux-musl.tar.gz" \
| tar xzf - -C ~/bin
- name: Add release metadata
run: |
cd release-meta
~/bin/mukti-bin --json releases.json 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 redirects
run: |
cd release-meta
~/bin/mukti-bin --json releases.json generate-redirects --flavor cloudflare . \
--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: Add extra redirects
run: |
cat nextest/site/release-meta-static/extra-redirects >> release-meta/_redirects
- name: Update release-meta repo
run: |
cd release-meta
git config user.email "[email protected]"
git config user.name "Nextest Bot"
git pull --autostash --rebase origin main
git add releases.json _redirects
git commit -m "Update release metadata for ${{ github.ref_name }}"
git push origin HEAD:main
- name: Run cargo-release-publish.sh
run: |
cd nextest
./scripts/cargo-release-publish.sh
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}