Skip to content

feat: Enhance the CI process #6

feat: Enhance the CI process

feat: Enhance the CI process #6

Workflow file for this run

name: CI
on:
push:
branches: [ "canary", "[0-9]+-[0-9]+-[0-9]+" ]
pull_request:
branches: [ "canary" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: fmt
run: cargo fmt --check --verbose
- name: clippy
run: cargo clippy -- -D warnings --verbose
- name: build
run: cargo build --verbose
- name: test
run: cargo test --verbose
release:
name: Release Build and Publish
# if: github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
matrix:
job:
- os: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: macos-13
target: x86_64-apple-darwin
use-cross: false
- os: windows-latest
target: x86_64-pc-windows-msvc
use-cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: true
- os: ubuntu-latest
target: i686-unknown-linux-gnu
use-cross: true
- os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
use-cross: true
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
use-cross: true
steps:
- uses: actions/checkout@v4
# - name: Add Cross Compilation Targets
# run: |
# rustup target add ${{ matrix.target }}
- name: Build Release Binary
run: cargo build --release --target ${{ matrix.target }}
- name: Archive Binary
run: |
mkdir -p dist
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
cp target/${{ matrix.target }}/release/katharsis.exe dist/katharsis-${{ matrix.target }}.exe
else
cp target/${{ matrix.target }}/release/katharsis dist/katharsis-${{ matrix.target }}
fi
# - name: Upload Binary to GitHub Releases
# uses: softprops/action-gh-release@v1
# with:
# files: dist/*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}