Github release workflow #5
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: Master Branch CI | |
on: | |
push: | |
branches: [ "main", "master" ] | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
- '.gitignore' | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
test-and-lint: | |
name: Test and Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.78.0 | |
components: clippy, rustfmt | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-directories: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
target | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Run tests | |
run: cargo test | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: cargo clippy --all-targets | |
build: | |
name: Build Release (${{ matrix.runner }}) | |
needs: test-and-lint | |
strategy: | |
matrix: | |
include: | |
- runner: ubuntu-latest | |
artifact_name: ghost-resend-mailer-x86_64-linux | |
- runner: ubuntu-latest-arm64 | |
artifact_name: ghost-resend-mailer-aarch64-linux | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.78.0 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Build release | |
run: cargo build --release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: target/release/ghost-resend-mailer | |
retention-days: 7 |