[mukti-bin] version 0.7.8 #41
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 | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
persist-credentials: false | |
- name: Install cargo release | |
uses: taiki-e/install-action@6da51af62171044932d435033daa70a0eb3383ba # v2 | |
with: | |
tool: [email protected] | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
persist-credentials: false | |
- uses: taiki-e/create-gh-release-action@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Install Rust | |
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- uses: taiki-e/upload-rust-binary-action@4398438f25ce68e99e82e90744c88604b9b218a3 # v1 | |
with: | |
bin: mukti-bin | |
archive: $tag-$target | |
target: ${{ matrix.target }} | |
tar: all | |
zip: windows | |
checksum: b2,sha256 | |
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: nextest-rs/mukti-release-meta | |
ref: main | |
token: ${{ secrets.RELEASE_META_DEPLOY_TOKEN }} | |
- name: Add release to releases.json | |
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 | |
~/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 |