-
Notifications
You must be signed in to change notification settings - Fork 3
300 lines (250 loc) · 8.74 KB
/
stable.yaml
File metadata and controls
300 lines (250 loc) · 8.74 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
name: Release Stable Binary's, Docker image and Publish to Crates.io
on:
workflow_dispatch:
permissions:
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
jobs:
app_version:
name: Get App Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from Cargo.toml
id: get_version
run: |
version=$(grep '^version' Cargo.toml | head -n1 | sed -E 's/version = "(.*)"/\1/')
echo "version=$version" >> $GITHUB_OUTPUT
linux_amd64_binary:
name: Prepare Linux AMD64 Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Docker DinD
uses: docker/setup-buildx-action@v3
- name: Install Rust Cross Lib
run: |
cargo install cross --version 0.2.4
- name: Build with Cross
run: |
cross build --target x86_64-unknown-linux-gnu --release -p phlow-runtime
- name: Upload Linux binary artifact
uses: actions/upload-artifact@v4
with:
name: phlow-binary-linux-amd64
path: ./target/x86_64-unknown-linux-gnu/release/phlow
- name: Build phlow-cli-inspect with Cross
run: |
cross build --target x86_64-unknown-linux-gnu --release -p phlow-tui-inspect
- name: Upload phlow-cli-inspect Linux artifact
uses: actions/upload-artifact@v4
with:
name: phlow-cli-inspect-linux-amd64
path: ./target/x86_64-unknown-linux-gnu/release/phlow-tui-inspect
linux_arm64_binary:
name: Prepare Linux ARM64 Binary
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Docker DinD
uses: docker/setup-buildx-action@v3
- name: Install Rust Cross Lib
run: |
cargo install cross --version 0.2.4
- name: Build with Cross
run: |
cross build --target aarch64-unknown-linux-gnu --release -p phlow-runtime
- name: Upload Linux binary artifact
uses: actions/upload-artifact@v4
with:
name: phlow-binary-linux-arm64
path: ./target/aarch64-unknown-linux-gnu/release/phlow
- name: Build phlow-cli-inspect with Cross
run: |
cross build --target aarch64-unknown-linux-gnu --release -p phlow-tui-inspect
- name: Upload phlow-cli-inspect Linux artifact
uses: actions/upload-artifact@v4
with:
name: phlow-cli-inspect-linux-arm64
path: ./target/aarch64-unknown-linux-gnu/release/phlow-tui-inspect
build_macos:
name: Build Binary for macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build with Cargo
run: |
cargo build --release -p phlow-runtime
cargo build --release -p phlow-tui-inspect
- name: Upload macOS binary
uses: actions/upload-artifact@v4
with:
name: phlow-binary-macos
path: target/release/phlow
- name: Upload phlow-cli-inspect macOS binary
uses: actions/upload-artifact@v4
with:
name: phlow-cli-inspect-macos
path: target/release/phlow-tui-inspect
tag:
name: Tag Release
runs-on: ubuntu-latest
needs:
- app_version
- linux_amd64_binary
- linux_arm64_binary
- build_macos
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create Git Tag
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git fetch --tags
git tag "v${{ needs.app_version.outputs.version }}"
git push origin "v${{ needs.app_version.outputs.version }}"
github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs:
- app_version
- linux_amd64_binary
- linux_arm64_binary
- build_macos
- tag
steps:
- name: Download Linux binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-linux-amd64
path: ./linux-amd64
- name: Download Linux binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-linux-arm64
path: ./linux-arm64
- name: Download macOS binary
uses: actions/download-artifact@v4
with:
name: phlow-binary-macos
path: ./macos
- name: Download phlow-cli-inspect Linux AMD64 binary
uses: actions/download-artifact@v4
with:
name: phlow-cli-inspect-linux-amd64
path: ./linux-amd64-inspect
- name: Download phlow-cli-inspect Linux ARM64 binary
uses: actions/download-artifact@v4
with:
name: phlow-cli-inspect-linux-arm64
path: ./linux-arm64-inspect
- name: Download phlow-cli-inspect macOS binary
uses: actions/download-artifact@v4
with:
name: phlow-cli-inspect-macos
path: ./macos-inspect
- name: Rename binaries
run: |
mv ./linux-amd64/phlow ./linux-amd64/phlow-amd64
mv ./linux-arm64/phlow ./linux-arm64/phlow-arm64
mv ./macos/phlow ./macos/phlow-macos
mv ./linux-amd64-inspect/phlow-tui-inspect ./linux-amd64-inspect/phlow-cli-inspect-amd64
mv ./linux-arm64-inspect/phlow-tui-inspect ./linux-arm64-inspect/phlow-cli-inspect-arm64
mv ./macos-inspect/phlow-tui-inspect ./macos-inspect/phlow-cli-inspect-macos
- name: Upload binaries to GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.app_version.outputs.version }}
name: Release v${{ needs.app_version.outputs.version }}
files: |
./linux-amd64/phlow-amd64
./linux-arm64/phlow-arm64
./macos/phlow-macos
./linux-amd64-inspect/phlow-cli-inspect-amd64
./linux-arm64-inspect/phlow-cli-inspect-arm64
./macos-inspect/phlow-cli-inspect-macos
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_docker:
name: Build Docker Multi-Platform and Export Linux Binary
runs-on: ubuntu-latest
needs: [github-release, app_version]
env:
VERSION: ${{ needs.app_version.outputs.version }}
OWNER: ${{ github.repository_owner }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Assert version is available
run: |
if [ -z "${VERSION}" ]; then
echo "ERROR: VERSION is empty (needs.app_version.outputs.version)" >&2
exit 1
fi
echo "Using VERSION=${VERSION}"
- name: Build and push multi-platform Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.cross.gnu
platforms: linux/amd64,linux/arm64
build-args: |
PHLOW_VERSION=${{ env.VERSION }}
push: true
tags: |
ghcr.io/${{ env.OWNER }}/phlow:latest
ghcr.io/${{ env.OWNER }}/phlow:${{ env.VERSION }}
publish:
needs: [tag]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Publish phs
run: cargo publish -p phs --token "$CARGO_REGISTRY_TOKEN" --no-verify
- name: Wait for phs
run: sleep 30
- name: Publish phlow-sdk
run: cargo publish -p phlow-sdk --token "$CARGO_REGISTRY_TOKEN" --no-verify
- name: Wait for phlow-sdk
run: sleep 30
- name: Publish phlow-engine
run: cargo publish -p phlow-engine --token "$CARGO_REGISTRY_TOKEN" --no-verify
- name: Wait for phlow-engine
run: sleep 30
- name: Publish phlow-runtime
run: cargo publish -p phlow-runtime --token "$CARGO_REGISTRY_TOKEN" --no-verify
- name: Publish phlow-cli-inspect
run: cargo publish -p phlow-tui-inspect --token "$CARGO_REGISTRY_TOKEN" --no-verify