Skip to content

Commit bdca94c

Browse files
committed
Add workflow
1 parent ce26588 commit bdca94c

2 files changed

Lines changed: 97 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test-and-build:
14+
name: Build & Test on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
with:
26+
components: clippy, rustfmt
27+
28+
- name: Check Formatting
29+
run: cargo fmt -- --check
30+
31+
- name: Lint with Clippy
32+
run: cargo clippy -- -D warnings
33+
34+
- name: Run Tests
35+
run: cargo test --verbose
36+
37+
- name: Build Release
38+
run: cargo build --release

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
create-release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Create GitHub Release
22+
uses: softprops/action-gh-release@v2
23+
with:
24+
generate_release_notes: true
25+
26+
build-and-upload:
27+
name: Build and Upload for ${{ matrix.os }}
28+
needs: create-release
29+
runs-on: ${{ matrix.os }}
30+
permissions:
31+
contents: write
32+
strategy:
33+
matrix:
34+
include:
35+
- os: ubuntu-latest
36+
target: x86_64-unknown-linux-gnu
37+
- os: macos-latest
38+
target: x86_64-apple-darwin
39+
- os: macos-14
40+
target: aarch64-apple-darwin
41+
- os: windows-latest
42+
target: x86_64-pc-windows-msvc
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Install Rust
49+
uses: dtolnay/rust-toolchain@stable
50+
with:
51+
targets: ${{ matrix.target }}
52+
53+
- name: Build and Upload Binary
54+
uses: taiki-e/upload-rust-binary-action@v1
55+
with:
56+
bin: lumen
57+
target: ${{ matrix.target }}
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
archive: $bin-$target

0 commit comments

Comments
 (0)