[cargo-hakari] version 0.9.31 #77
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: | |
target-spec-release: | |
# There's no regex filtering in if conditionals, so we need to use the first component of the version number. | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'target-spec-3') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: target-spec | |
changelog: target-spec/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
target-spec-miette-release: | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'target-spec-miette-') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: target-spec-miette | |
changelog: target-spec-miette/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
guppy-summaries-release: | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'guppy-summaries-') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: guppy-summaries | |
changelog: guppy-summaries/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
guppy-release: | |
# There's no regex filtering in if conditionals, so we need to use the first component of the version number. | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'guppy-0') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: guppy | |
changelog: guppy/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
determinator-release: | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'determinator-') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: determinator | |
changelog: tools/determinator/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
hakari-release: | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'hakari-') | |
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@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # v1 | |
with: | |
prefix: hakari | |
changelog: tools/hakari/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
cargo-hakari-release: | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'cargo-hakari-') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
persist-credentials: false | |
# Note: do not publish this to crates.io 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-hakari | |
changelog: tools/cargo-hakari/CHANGELOG.md | |
title: $prefix $version | |
branch: main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
version: ${{ steps.create-gh-release.outputs.version }} | |
build-cargo-hakari-binaries: | |
name: Build cargo-hakari binaries for ${{ matrix.target }} | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'cargo-hakari-') | |
needs: | |
- cargo-hakari-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 | |
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@4cb589740b9124d524fd00973bb4f2082bb55d10 # v1 | |
with: | |
bin: cargo-hakari | |
# 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 | |
- 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 }} | |
publish-cargo-hakari: | |
name: Publish cargo-hakari to crates.io | |
if: github.repository_owner == 'guppy-rs' && startsWith(github.ref_name, 'cargo-hakari-') | |
needs: | |
- cargo-hakari-release | |
- build-cargo-hakari-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo release | |
uses: taiki-e/install-action@3451569d988f3b0b3eaccd1d1b539a75ec96f192 # v2 | |
with: | |
tool: [email protected] | |
- run: ./scripts/cargo-release-publish.sh | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |