Skip to content

[hakari] version 0.17.0 #57

[hakari] version 0.17.0

[hakari] version 0.17.0 #57

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:
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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
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@9762dfdfe60a96b3fef6c4a0aaafd9840f1195b7 # 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
container: ubuntu:18.04
- 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 == 'ubuntu:18.04'
run: |
set -eu
apt-get -qq update
apt-get install -y software-properties-common sudo build-essential curl jq
add-apt-repository ppa:git-core/ppa
apt-get -qq update
apt-get -qq -y install git-core
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
# gh is required by taiki-e/upload-rust-binary-action
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt-get -qq update \
&& sudo apt-get -qq -y install gh
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/upload-rust-binary-action@c53aeb3a143a2b61773f7833bae48f4d66e255ce # v1
with:
bin: cargo-hakari
# 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 }}
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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- 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
- run: ./scripts/cargo-release-publish.sh
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}