chore: changes app to correct version #73
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: Build & Release | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
format: | |
name: fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@1.76.0 | |
with: | |
components: rustfmt | |
- name: Check formatting | |
run: | | |
cargo fmt --all -- --check | |
clippy: | |
name: clippy | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@1.76.0 | |
with: | |
components: clippy | |
- name: Check the lints | |
run: | | |
cargo clippy -- -D warnings | |
test: | |
name: test | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@1.76.0 | |
- name: Unit Test | |
run: | | |
cargo test --workspace | |
env: | |
RUST_BACKTRACE: 1 | |
build: | |
name: Build | |
needs: [format, clippy, test] | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
target: | |
[ | |
x86_64-apple-darwin, | |
aarch64-unknown-linux-gnu, | |
x86_64-unknown-linux-gnu, | |
aarch64-apple-darwin, | |
] | |
include: | |
- target: x86_64-apple-darwin | |
os: macos | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu | |
- target: aarch64-apple-darwin | |
os: macos | |
steps: | |
- name: Install toolchain for ${{ matrix.target }} | |
uses: dtolnay/rust-toolchain@1.76.0 | |
with: | |
targets: ${{ matrix.target }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
run: | | |
if [ ${{ matrix.os }} == 'macos' ]; then | |
cargo build --release --bins --target ${{ matrix.target }} | |
else | |
cargo install cross | |
cross build --release --bins --target ${{ matrix.target }} | |
fi | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cl-${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/ | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout releaser | |
uses: actions/checkout@v4 | |
with: | |
repository: rvigo/rustreleaser | |
- name: Build releaser | |
run: | | |
cargo build --release | |
sudo cp -R ./target/release/rustreleaser /usr/local/bin/. | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download darwin_arm64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: cl-aarch64-apple-darwin | |
path: target/aarch64-apple-darwin/release/ | |
- name: Download darwin_amd64_v1 | |
uses: actions/download-artifact@v4 | |
with: | |
name: cl-x86_64-apple-darwin | |
path: target/x86_64-apple-darwin/release/ | |
- name: Download linux_amd64_v1 | |
uses: actions/download-artifact@v4 | |
with: | |
name: cl-x86_64-unknown-linux-gnu | |
path: target/x86_64-unknown-linux-gnu/release/ | |
- name: Download linux_arm64 | |
uses: actions/download-artifact@v4 | |
with: | |
name: cl-aarch64-unknown-linux-gnu | |
path: target/aarch64-unknown-linux-gnu/release/ | |
- name: Release | |
run: | | |
rustreleaser | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |