Skip to content

Commit 4c01571

Browse files
authored
feat: add release yaml (prefix-dev#183)
1 parent f7113cf commit 4c01571

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
target:
15+
- x86_64-unknown-linux-gnu
16+
- x86_64-pc-windows-gnu
17+
- x86_64-apple-darwin
18+
- aarch64-apple-darwin
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Install Rust
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
target: ${{ matrix.target }}
29+
override: true
30+
31+
- name: Install Dependencies
32+
run: rustup target add ${{ matrix.target }}
33+
34+
- name: Build
35+
run: cargo build --release --target ${{ matrix.target }}
36+
37+
- name: Upload Artifact
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: shell-${{ matrix.target }}
41+
path: target/${{ matrix.target }}/release/shell
42+
43+
release:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v3
50+
51+
- name: Upload to Release
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
files: |
55+
**/shell-x86_64-unknown-linux-gnu
56+
**/shell-x86_64-pc-windows-gnu.exe
57+
**/shell-x86_64-apple-darwin
58+
**/shell-aarch64-apple-darwin
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)