Skip to content

Commit 82620d6

Browse files
Update rust.yml
1 parent c4298a1 commit 82620d6

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/rust.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: CI for Rust Project
22

33
on:
44
push:
@@ -10,13 +10,39 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13+
# The original job to build and test on Ubuntu.
1314
build:
14-
1515
runs-on: ubuntu-latest
16-
1716
steps:
1817
- uses: actions/checkout@v4
18+
- name: Set up Rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
1920
- name: Build
2021
run: cargo build --verbose
2122
- name: Run tests
2223
run: cargo test --verbose
24+
25+
# A new job specifically for building a macOS binary.
26+
# This job will run in parallel with the 'build' job.
27+
build-macos:
28+
# Use a macOS runner for this job.
29+
runs-on: macos-latest
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Rust toolchain
36+
uses: dtolnay/rust-toolchain@stable
37+
38+
# Build the project for the native macOS architecture (aarch64 for Apple Silicon).
39+
- name: Build project for macOS (aarch64)
40+
run: cargo build --release --target aarch64-apple-darwin
41+
42+
# Package the resulting binary as an artifact for easy download.
43+
# The path assumes your crate is named "LSTimer". Adjust if necessary.
44+
- name: Upload artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: macos-release-build
48+
path: target/aarch64-apple-darwin/release/LSTimer

0 commit comments

Comments
 (0)