-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (132 loc) · 4.48 KB
/
Copy pathrelease.yml
File metadata and controls
156 lines (132 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build-linux-windows:
name: Build Linux and Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y libclang-dev gcc-aarch64-linux-gnu gcc-mingw-w64-x86-64
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu,x86_64-pc-windows-gnu
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: linux-windows-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: linux-windows-cargo-
- name: Build Linux x86_64
run: cargo build --release --locked --target x86_64-unknown-linux-gnu
- name: Build Linux aarch64
run: cargo build --release --locked --target aarch64-unknown-linux-gnu
env:
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Build Windows x86_64
run: cargo build --release --locked --target x86_64-pc-windows-gnu
env:
CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc
- name: Stage artifacts
run: |
cp target/x86_64-unknown-linux-gnu/release/stellui stellui-linux-x86_64
cp target/aarch64-unknown-linux-gnu/release/stellui stellui-linux-aarch64
cp target/x86_64-pc-windows-gnu/release/stellui.exe stellui-windows-x86_64.exe
- uses: actions/upload-artifact@v4
with:
name: linux-windows-artifacts
path: |
stellui-linux-x86_64
stellui-linux-aarch64
stellui-windows-x86_64.exe
if-no-files-found: error
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin,aarch64-apple-darwin
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: macos-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: macos-cargo-
- name: Build macOS x86_64
run: cargo build --release --locked --target x86_64-apple-darwin
- name: Build macOS aarch64
run: cargo build --release --locked --target aarch64-apple-darwin
- name: Stage artifacts
run: |
cp target/x86_64-apple-darwin/release/stellui stellui-macos-x86_64
cp target/aarch64-apple-darwin/release/stellui stellui-macos-aarch64
- uses: actions/upload-artifact@v4
with:
name: macos-artifacts
path: |
stellui-macos-x86_64
stellui-macos-aarch64
if-no-files-found: error
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs:
- build-linux-windows
- build-macos
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libclang-dev
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish
run: cargo publish --locked
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs:
- build-linux-windows
- build-macos
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: Create release and upload binaries
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/stellui-linux-x86_64
artifacts/stellui-linux-aarch64
artifacts/stellui-windows-x86_64.exe
artifacts/stellui-macos-x86_64
artifacts/stellui-macos-aarch64
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}