Tag as v1.0.0 #5
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
# Builds binaries and uploads them to a GitHub release when a v* tag is pushed. | |
name: Publish release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
create-release: | |
name: Create release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
steps: | |
- name: Create release | |
id: create-release | |
uses: softprops/action-gh-release@v2 | |
build: | |
name: Build release binaries | |
runs-on: ${{ matrix.runner-os }} | |
needs: create-release | |
strategy: | |
matrix: | |
include: | |
- runner-os: ubuntu-latest | |
rustc-target: "x86_64-unknown-linux-gnu" | |
- runner-os: ubuntu-latest | |
rustc-target: "aarch64-unknown-linux-gnu" | |
- runner-os: macos-latest | |
rustc-target: "x86_64-apple-darwin" | |
- runner-os: macos-latest | |
rustc-target: "aarch64-apple-darwin" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.rustc-target }} | |
- name: Build | |
run: | | |
cargo build --release | |
- name: Create tarball | |
run: | | |
mkdir out | |
cp target/release/docker-reaper out/ | |
cp README.md LICENSE-MIT LICENSE-APACHE CHANGELOG.md out/ | |
cd out && tar czf docker-reaper-${suffix}.tar.gz * | |
env: | |
suffix: ${{ matrix.rustc-target }} | |
- name: Upload tarball | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: out/*.tar.gz |