Release build #15
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 build | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Lint | |
run: | | |
cargo clippy | |
cargo clippy --release | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test | |
run: | | |
cargo test | |
build: | |
strategy: | |
matrix: | |
arch: | |
- { | |
name: "x86_64", | |
os: "ubuntu-latest", | |
target: "x86_64-unknown-linux-gnu", | |
cross: false, | |
} | |
runs-on: ${{ matrix.arch.os }} | |
steps: | |
- name: Get the version | |
id: version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
shared-key: cargo-cache-${{ matrix.arch.target }} | |
- run: rm -rf .git/ | |
- name: Build | |
run: | | |
cargo build --release --target=${{ matrix.arch.target }} | |
- name: Rename artifact | |
run: mv target/${{ matrix.arch.target }}/release/tuigreet target/${{ matrix.arch.target }}/release/tuigreet-${{ steps.version.outputs.VERSION }}-${{ matrix.arch.name }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tuigreet-${{ steps.version.outputs.VERSION }}-${{ matrix.arch.name }} | |
path: target/${{ matrix.arch.target }}/release/tuigreet-${{ steps.version.outputs.VERSION }}-${{ matrix.arch.name }} | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: target/out | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ github.ref }} | |
prerelease: true | |
tag: ${{ github.ref }} | |
artifacts: target/out/*/* |