Skip to content

Release

Release #3

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- 'v\d\.\d\.\d'
defaults:
run:
shell: bash
permissions:
contents: write
jobs:
release:
name: Build and Archive
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# macOS, aarch64
- target: aarch64-apple-darwin
os: macos-latest
target_rustflags: ''
# Windoze, x86-64
- target: x86_64-pc-windows-gnu
os: windows-latest
target_rustflags: ''
# Linux, x86-64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
target_rustflags: ''
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchains
uses: dtolnay/rust-toolchain@beta
with:
toolchain: beta
targets: ${{ matrix.target }}
- name: Install Nu Shell
uses: hustcer/setup-nu@v3
with:
version: '0.100'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build an rabbitmqadmin release archive on macOS
id: release-build-macos
if: ${{ matrix.os == 'macos-latest' }}
run: nu ./scripts/release-macos.nu
env:
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
SRC: ${{ github.workspace }}
- name: Store macOS build artifact
id: upload-macos-artifact
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/upload-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.tar.gz"
path: "${{ github.workspace }}/target/${{ matrix.target }}/release/rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.tar.gz"
retention-days: 2
- name: Build an rabbitmqadmin release archive on Linux
id: release-build-linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: nu ./scripts/release-linux.nu
env:
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
SRC: ${{ github.workspace }}
- name: Store Linux build artifact
id: upload-linux-artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.tar.gz"
path: "${{ github.workspace }}/target/${{ matrix.target }}/release/rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.tar.gz"
retention-days: 2
- name: Build an rabbitmqadmin release archive on Windows
id: release-build-windows
if: ${{ matrix.os == 'windows-latest' }}
run: nu ./scripts/release-windows.nu
env:
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
SRC: ${{ github.workspace }}
- name: Store Windows build artifact
id: upload-windows-artifact
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.zip"
path: "${{ github.workspace }}/target/${{ matrix.target }}/release/rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-${{ matrix.target }}.zip"
retention-days: 2
create_gh_release:
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Fetch macOS archive
uses: actions/download-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-aarch64-apple-darwin.tar.gz"
path: ./artifacts
- name: Fetch Linux archive
uses: actions/download-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-x86_64-unknown-linux-gnu.tar.gz"
path: ./artifacts
- name: Fetch Windows archive
uses: actions/download-artifact@v4
with:
name: "rabbitmqadmin-${{ vars.NEXT_RELESE_VERSION }}-x86_64-pc-windows-gnu.zip"
path: ./artifacts
- name: Publish rabbitmqadmin release archive
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ vars.NEXT_RELESE_VERSION }}
draft: false
files: ./artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}