Release 0.4.0 #3
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
# Trigger a release when a tag is pushed that starts with v then some number. | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.*' | |
name: Release | |
jobs: | |
release: | |
name: Release | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write # Needed for creating releases | |
strategy: | |
matrix: | |
include: | |
- build: linux | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: ${{ matrix.target }} | |
- name: Extract release notes | |
shell: bash | |
run: | | |
awk "/# Version ${GITHUB_REF_NAME#v}/{flag=1; next} /^$/{flag=0} flag" RELEASE_NOTES.md >REL.md | |
- name: Build release binary | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Create tarballs (Unix) | |
if: matrix.build == 'linux' | |
run: | | |
n="cackle-${{ github.ref_name }}-${{ matrix.target }}" | |
mkdir "$n" | |
cp "target/${{ matrix.target }}/release/cargo-acl" "$n" | |
tar zcf $n.tar.gz $n | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: REL.md | |
files: | | |
cackle-v*.* |