-
Notifications
You must be signed in to change notification settings - Fork 218
273 lines (254 loc) · 8.8 KB
/
release.yaml
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# This workflow runs on tags / releases. It also runs on nightly builds without
# publishing anything, in order to test as much of the build works as possible.
#
# We indicate whether it should publish, vs. just build, by checking if we're on
# a tag. (An alternative would be to have an input which is passed in by the
# calling workflow.)
name: release
on:
release:
types: [released]
workflow_call:
workflow_dispatch:
jobs:
brew-dispatcher:
name: Release on homebrew-prql
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'prql',
repo: 'homebrew-prql',
workflow_id: 'update.yaml',
ref: 'main',
inputs: {
version: '${{ github.ref }}',
URL: 'https://github.com/PRQL/prql/archive/${{ github.ref }}.tar.gz'
}
})
build-prqlc:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/build-prqlc
id: build-artifact
with:
target: ${{ matrix.target }}
profile: release
- name: Upload release artifact
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
append_body: true
files: ${{ steps.build-artifact.outputs.artifact-name }}
winget-release:
runs-on: ubuntu-latest
needs: build-prqlc
if: github.event_name == 'release'
steps:
- name: publish
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: PRQL.prqlc
version: ${{ github.ref_name }}
installers-regex: '^prqlc-.*-windows-.*\.zip$'
token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }}
fork-user: prql-bot
build-deb-package:
# TODO: currently this doesn't publish it as an artifact; would be a welcome contribution
# to add that (and eventually as a release asset)
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: 👷 Build prql-compiler
run: cargo build --release -p prqlc
- name: Copy files into .deb package
run: |
mkdir -p .debpkg/usr/bin
cp target/release/prqlc .debpkg/usr/bin/prqlc
chmod +x .debpkg/usr/bin/prqlc
- name: 📦 Build .deb package
uses: jiro4989/build-deb-action@v3
with:
package: prqlc
package_root: .debpkg
maintainer: The PRQL Project
version: ${{ github.event_name == 'release' && github.ref_name || 0 }}
desc: >
prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and
offers various diagnostics.
PRQL is a modern language for transforming data — a simple,
powerful, pipelined SQL replacement.
build-rpm-package:
# TODO: This doesn't publish the rpm yet, that would be a welcome follow-up (even as a CI artifact)
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: 👷 Build prqlc
run: cargo build --bin prqlc --release
- name: Copy files into .rpm package
run: |
mkdir -p .rpmpkg/usr/bin
cp target/release/prqlc .rpmpkg/usr/bin/prqlc
chmod +x .rpmpkg/usr/bin/prqlc
- name: 📦 Build .rpm package
uses: jiro4989/build-rpm-action@v2
with:
summary: CLI for PRQL, a modern language for transforming data
package: prqlc
package_root: .rpmpkg
maintainer: The PRQL Project
vendor: The PRQL Project
version: ${{ github.event_name == 'release' && github.ref_name || 0 }}
desc: >
prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and
offers various diagnostics.
PRQL is a modern language for transforming data — a simple,
powerful, pipelined SQL replacement.
license: Apache-2.0
build-and-publish-snap:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: Move Snap to project root directory
run: cp -r prqlc/packages/snap/ .
- name: 📦 Build Snap
id: build
uses: snapcore/action-build@v1
- name: 🆙 Publish Snap
if: github.event_name == 'release'
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS:
${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
build-python-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64
- os: ubuntu-latest
target: aarch64
- os: ubuntu-latest
target: source
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- uses: ./.github/actions/build-prql-python
with:
target: ${{ matrix.target }}
publish-prql-python:
runs-on: ubuntu-latest
needs: [build-python-wheels]
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *
publish-prql-js:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- uses: baptiste0928/cargo-install@v2
with:
crate: wasm-pack
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
# This is only required in order to have `cross-env` installed, since `npx
# cross-env` doesn't seem to work in CI (https://github.com/PRQL/prql/pull/3728)
- run: npm install
working-directory: prqlc/bindings/js/
- run:
npm publish ${{ (github.event_name != 'release') && '--dry-run' || ''
}}
working-directory: prqlc/bindings/js/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-to-cargo:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-release
# Currently, we can only check prqlc-ast which is not dependent other local crates with --dry-run.
# https://github.com/crate-ci/cargo-release/issues/691
# --no-verify is required to prevent build.
- run:
cargo release publish --no-confirm ${{ github.event_name == 'release'
&& '--execute' || '--no-verify --package prqlc-ast'}}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# Requires another pass: https://github.com/PRQL/prql/issues/850
# publish-prql-java:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Install Java and Maven
# uses: actions/setup-java@v3
# with:
# java-version: 8
# - name: Release Maven package
# uses: samuelmeuli/action-maven-publish@v1
# with:
# gpg_private_key: ${{ secrets.gpg_private_key }}
# gpg_passphrase: ${{ secrets.gpg_passphrase }}
# nexus_username: ${{ secrets.nexus_username }}
# nexus_password: ${{ secrets.nexus_password }}
# directory: prql-java/java/
push-web-branch:
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- run: git push origin HEAD:web --force
push-devcontainer:
if: github.event_name == 'release'
uses: ./.github/workflows/build-devcontainer.yaml
with:
# TOOD: I think having this as a bool is OK, but check a recent release
# from 0.10.0 and confirm that it is indeed pushing the image.
push: true