-
Notifications
You must be signed in to change notification settings - Fork 16
251 lines (197 loc) · 6.42 KB
/
release-packages.yml
File metadata and controls
251 lines (197 loc) · 6.42 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Release Cargo and Installer Packages
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build-windows:
name: Build Windows Installers
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install tree-sitter-cli
run: npm install -g tree-sitter-cli
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: windows-release
- name: Install cargo-packager
run: cargo install cargo-packager --locked
- name: Build ggsql binary
run: cargo build --release --package ggsql --bin ggsql
- name: Build NSIS installer
run: cargo packager --release --formats nsis
working-directory: src
- name: Build MSI installer
run: cargo packager --release --formats wix
working-directory: src
- name: Upload NSIS installer
uses: actions/upload-artifact@v4
with:
name: ggsql-windows-nsis
path: src/target/release/packager/*.exe
retention-days: 30
- name: Upload MSI installer
uses: actions/upload-artifact@v4
with:
name: ggsql-windows-msi
path: src/target/release/packager/*.msi
retention-days: 30
build-macos:
name: Build macOS Installers
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install tree-sitter-cli
run: npm install -g tree-sitter-cli
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin, aarch64-apple-darwin
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: macos-release
- name: Install cargo-packager
run: cargo install cargo-packager --locked
- name: Build ggsql binary (x86_64)
run: cargo build --release --package ggsql --bin ggsql
- name: Build DMG installer (x86_64)
run: cargo packager --release --formats dmg
working-directory: src
- name: Build ggsql binary (aarch64)
run: cargo build --release --package ggsql --bin ggsql --target aarch64-apple-darwin
- name: Build DMG installer (aarch64)
run: cargo packager --release --target aarch64-apple-darwin --formats dmg
working-directory: src
- name: Upload DMG installers
uses: actions/upload-artifact@v4
with:
name: ggsql-macos-dmg
path: src/target/release/packager/*.dmg
retention-days: 30
build-linux:
name: Build Linux Installers
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install tree-sitter-cli
run: npm install -g tree-sitter-cli
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: linux-release
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: Install cargo-packager
run: cargo install cargo-packager --locked
- name: Build ggsql binary
run: cargo build --release --package ggsql --bin ggsql
- name: Build Debian package
run: cargo packager --release --formats deb
working-directory: src
- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: ggsql-linux-deb
path: src/target/release/packager/*.deb
retention-days: 30
build-cargo:
name: Publish to crates.io
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install tree-sitter-cli
run: npm install -g tree-sitter-cli
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: cargo-publish
- name: Get crates.io publish token
uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: Build tree-sitter-ggsql
run: cargo build --package tree-sitter-ggsql
- name: Publish tree-sitter-ggsql
run: cargo publish --package tree-sitter-ggsql --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: Wait for crates.io index update
run: sleep 30
- name: Publish ggsql
run: cargo publish --package ggsql
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: Wait for crates.io index update
run: sleep 30
- name: Publish ggsql-jupyter
run: cargo publish --package ggsql-jupyter
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
create-release:
name: Create GitHub Release
needs: [build-windows, build-macos, build-linux, build-cargo]
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- name: Create release and upload installers
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/**/*.exe
artifacts/**/*.msi
artifacts/**/*.dmg
artifacts/**/*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}