Skip to content

Commit 0e70d02

Browse files
committed
build binary with github pipeline
1 parent d310504 commit 0e70d02

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/pipeline.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Rust Binary
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: macos-latest
14+
15+
strategy:
16+
matrix:
17+
architecture: [x86_64-apple-darwin, aarch64-apple-darwin]
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Rust
24+
uses: actions-rust-lang/setup-rust-toolchain@v1
25+
with:
26+
profile: minimal
27+
target: ${{ matrix.architecture }}
28+
toolchain: stable
29+
30+
- name: Build Rust binary
31+
run: cargo build --release --target ${{ matrix.architecture }}
32+
33+
- name: Rename binary
34+
run: mv target/${{ matrix.architecture }}/release/worktimers target/${{ matrix.architecture }}/release/worktimers-darwin-${{ matrix.architecture }}
35+
36+
- name: Upload binary
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
files: target/${{ matrix.architecture }}/release/worktimers-darwin-${{ matrix.architecture }}
40+
tag_name: v1.0.${{ github.run_number }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)