build: v0.1.2 #6
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
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
name: Build ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
name: tack-linux.tar.gz | |
- os: macos-latest | |
name: tack-macos.tar.gz | |
- os: windows-latest | |
name: tack-windows.zip | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
run: cargo build --release --locked | |
- name: Archive | |
if: matrix.os == 'windows-latest' | |
run: | | |
copy target\release\tac.exe tac.exe | |
7z a ${{ matrix.name }} tac.exe README.md CONTRIBUTORS.md LICENSE-MIT LICENSE-APACHE | |
- name: Archive | |
if: matrix.os != 'windows-latest' | |
run: | | |
cp target/release/tac tac | |
tar czvf ${{ matrix.name }} tac README.md CONTRIBUTORS.md LICENSE-MIT LICENSE-APACHE | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }} | |
if-no-files-found: error | |
release: | |
needs: build | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: tack-* | |
fail_on_unmatched_files: true | |
cargo-publish: | |
needs: release | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Publish to crates.io | |
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |