Skip to content

[mukti-bin] version 0.7.3 #36

[mukti-bin] version 0.7.3

[mukti-bin] version 0.7.3 #36

Workflow file for this run

# adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml
name: Publish releases
on:
push:
tags:
- "*"
jobs:
mukti-metadata-release:
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'mukti-metadata-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- name: Install cargo release
uses: taiki-e/install-action@dabb9c1ee51c21c545764a0d517f069ff52e6477 # v2
with:
tool: [email protected]
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # v1
with:
prefix: mukti-metadata
changelog: mukti-metadata/CHANGELOG.md
title: $prefix $version
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: ./scripts/cargo-release-publish.sh --exclude mukti-bin
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
create-mukti-bin-release:
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'mukti-bin-')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
persist-credentials: false
- uses: taiki-e/create-gh-release-action@8df4de6534ceacdaed10a08f73418ca751f31793 # v1
with:
prefix: mukti-bin
title: $prefix $version
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get version number
id: get-version-number
run: |
TAG_NAME=${{ github.ref_name }}
VERSION=${TAG_NAME#"mukti-bin-"}
echo "The version number is $VERSION"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.get-version-number.outputs.version }}
upload-mukti-bin-assets:
name: Publish for ${{ matrix.target }}
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'mukti-bin-')
needs:
- create-mukti-bin-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Install Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
with:
toolchain: stable
profile: minimal
override: true
- uses: taiki-e/upload-rust-binary-action@aefa20ac5893ee9a660dd3e995c9dc9a715e93f0 # v1
with:
bin: mukti-bin
archive: $tag-$target
target: ${{ matrix.target }}
tar: all
zip: windows
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set archive output variable
id: archive-output
shell: bash
run: |
if [[ ${{ matrix.target }} == "x86_64-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:
linux-tar-gz: ${{ steps.archive-output.outputs.x86_64-unknown-linux-musl-tar }}
windows-tar-gz: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-tar }}
windows-zip: ${{ steps.archive-output.outputs.x86_64-pc-windows-msvc-zip }}
update-mukti-bin-release-meta:
name: Update release-meta repo
concurrency: ci-${{ github.ref }}
if: github.repository_owner == 'nextest-rs' && startsWith(github.ref_name, 'mukti-bin-')
needs:
- create-mukti-bin-release
- upload-mukti-bin-assets
runs-on: ubuntu-latest
steps:
- name: Check out release-meta repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
repository: nextest-rs/mukti-release-meta
ref: main
token: ${{ secrets.RELEASE_META_DEPLOY_TOKEN }}
- name: Fetch mukti assets
run: |
ARCHIVE_PREFIX="https://github.com/nextest-rs/mukti/releases/download/${{ github.ref_name }}"
mkdir -p ~/bin
curl -LsSf "$ARCHIVE_PREFIX/${{ needs.upload-mukti-bin-assets.outputs.linux-tar-gz }}" | tar xzf - -C ~/bin
- name: Add release to releases.json
run: |
~/bin/mukti-bin --json releases.json add-release \
--version ${{ needs.create-mukti-bin-release.outputs.version }} \
--release-url "https://github.com/nextest-rs/mukti/releases/${{ github.ref_name }}" \
--archive-prefix "$ARCHIVE_PREFIX" \
--archive x86_64-unknown-linux-musl:tar.gz=${{ needs.upload-mukti-bin-assets.outputs.linux-tar-gz }} \
--archive x86_64-pc-windows-msvc:tar.gz=${{ needs.upload-mukti-bin-assets.outputs.windows-tar-gz }} \
--archive x86_64-pc-windows-msvc:zip=${{ needs.upload-mukti-bin-assets.outputs.windows-zip }}
- name: Generate redirects
run: |
~/bin/mukti-bin --json releases.json generate-redirects --flavor cloudflare . \
--alias linux=x86_64-unknown-linux-musl:tar.gz \
--alias windows=x86_64-pc-windows-msvc:zip
- name: Update releases.json on main branch
run: |
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