Skip to content

chore(release): prepare for v0.4.2 #5

chore(release): prepare for v0.4.2

chore(release): prepare for v0.4.2 #5

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
env:
TAG: ${{ github.ref_name }}
REPO: ${{ github.repository }}
jobs:
create-release:
name: Create draft release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Generate release message
uses: orhun/git-cliff-action@v2
id: git-cliff
with:
config: cliff.toml
args: --current --strip all
- name: Create draft release
run: gh release create "$TAG" --verify-tag --draft --notes-file "${{ steps.git-cliff.outputs.changelog }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
name: Upload assets (${{ matrix.target }})
needs: create-release
strategy:
matrix:
include:
- { os: macos-latest, target: aarch64-apple-darwin }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, tools: binutils-aarch64-linux-gnu }
- { os: ubuntu-latest, target: aarch64-unknown-linux-musl, tools: binutils-aarch64-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: windows-latest, target: aarch64-pc-windows-msvc }
- { os: windows-latest, target: x86_64-pc-windows-msvc }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install extra tools
if: ${{ matrix.tools != '' }}
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ${{ matrix.tools }}
- name: Build and upload binary
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: wazzup
archive: $bin-$tag-$target
target: ${{ matrix.target }}
checksum: sha512
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-release:
name: Publish release
runs-on: ubuntu-latest
needs:
- create-release
- upload-assets
steps:
- name: Publish release
run: gh release edit --repo "$REPO" "$TAG" --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}