History

Nightly release channel (#2012)

Julius Marminge committed 7 months agonightly-v0.0.17-nightly.20260415.44

Commit 409ff901 parent 0d2802649 files · +1203 −131Browse files

Showing the changes to .github (2 of 49 files). Show all

Unified · Split

2 files
  1. .github/workflows/ci.yml +3 −0
  2. .github/workflows/release.yml +119 −39
.github/workflows/ci.yml+3−0
@@ -92,5 +92,8 @@ jobs: · 91 unmodified lines
92 with:92 with:
93 node-version-file: package.json93 node-version-file: package.json
94 94
95 - name: Install dependencies
96 run: bun install --frozen-lockfile
97
95 - name: Exercise release-only workflow steps98 - name: Exercise release-only workflow steps
96 run: node scripts/release-smoke.ts99 run: node scripts/release-smoke.ts
.github/workflows/release.yml+119−39
@@ -1,14 +1,24 @@
1name: Release Desktop1name: Release
2 2
3on:3on:
4 push:4 push:
5 tags:5 tags:
6 - "v*.*.*"6 - "v*.*.*"
7 schedule:
8 - cron: "0 9 * * *"
7 workflow_dispatch:9 workflow_dispatch:
8 inputs:10 inputs:
11 channel:
12 description: "Release channel"
13 required: false
14 default: stable
15 type: choice
16 options:
17 - stable
18 - nightly
9 version:19 version:
10 description: "Release version (for example 1.2.3 or v1.2.3)"20 description: "Release version (for example 1.2.3 or v1.2.3)"
11 required: true21 required: false
12 type: string22 type: string
13 23
14permissions:24permissions:
@@ -21,40 +31,21 @@ jobs: · 6 unmodified lines
21 runs-on: ubuntu-24.0431 runs-on: ubuntu-24.04
22 timeout-minutes: 1032 timeout-minutes: 10
23 outputs:33 outputs:
34 release_channel: ${{ steps.release_meta.outputs.release_channel }}
24 version: ${{ steps.release_meta.outputs.version }}35 version: ${{ steps.release_meta.outputs.version }}
25 tag: ${{ steps.release_meta.outputs.tag }}36 tag: ${{ steps.release_meta.outputs.tag }}
37 release_name: ${{ steps.release_meta.outputs.name }}
38 short_sha: ${{ steps.release_meta.outputs.short_sha }}
39 previous_tag: ${{ steps.previous_tag.outputs.previous_tag }}
40 cli_dist_tag: ${{ steps.release_meta.outputs.cli_dist_tag }}
26 is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}41 is_prerelease: ${{ steps.release_meta.outputs.is_prerelease }}
27 make_latest: ${{ steps.release_meta.outputs.make_latest }}42 make_latest: ${{ steps.release_meta.outputs.make_latest }}
28 ref: ${{ github.sha }}43 ref: ${{ github.sha }}
29 steps:44 steps:
30 - name: Checkout45 - name: Checkout
31 uses: actions/checkout@v646 uses: actions/checkout@v6
32 47 with:
33 - id: release_meta48 fetch-depth: 0
34 name: Resolve release version
35 shell: bash
36 run: |
37 if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
38 raw="${{ github.event.inputs.version }}"
39 else
40 raw="${GITHUB_REF_NAME}"
41 fi
42
43 version="${raw#v}"
44 if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
45 echo "Invalid release version: $raw" >&2
46 exit 1
47 fi
48
49 echo "version=$version" >> "$GITHUB_OUTPUT"
50 echo "tag=v$version" >> "$GITHUB_OUTPUT"
51 if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
52 echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
53 echo "make_latest=true" >> "$GITHUB_OUTPUT"
54 else
55 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
56 echo "make_latest=false" >> "$GITHUB_OUTPUT"
57 fi
58 49
59 - name: Setup Bun50 - name: Setup Bun
60 uses: oven-sh/setup-bun@v251 uses: oven-sh/setup-bun@v2
@@ -69,6 +60,60 @@ jobs: · 8 unmodified lines
69 - name: Install dependencies60 - name: Install dependencies
70 run: bun install --frozen-lockfile61 run: bun install --frozen-lockfile
71 62
63 - id: release_meta
64 name: Resolve release version
65 shell: bash
66 env:
67 DISPATCH_CHANNEL: ${{ github.event.inputs.channel }}
68 DISPATCH_VERSION: ${{ github.event.inputs.version }}
69 NIGHTLY_DATE: ${{ github.run_started_at }}
70 NIGHTLY_SHA: ${{ github.sha }}
71 NIGHTLY_RUN_NUMBER: ${{ github.run_number }}
72 run: |
73 if [[ "${GITHUB_EVENT_NAME}" == "schedule" || ( "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${DISPATCH_CHANNEL:-stable}" == "nightly" ) ]]; then
74 nightly_date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)"
75
76 node scripts/resolve-nightly-release.ts \
77 --date "$nightly_date" \
78 --run-number "$NIGHTLY_RUN_NUMBER" \
79 --sha "$NIGHTLY_SHA" \
80 --github-output
81
82 echo "release_channel=nightly" >> "$GITHUB_OUTPUT"
83 echo "cli_dist_tag=nightly" >> "$GITHUB_OUTPUT"
84 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
85 echo "make_latest=false" >> "$GITHUB_OUTPUT"
86 else
87 if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" ]]; then
88 raw="${DISPATCH_VERSION}"
89 if [[ -z "$raw" ]]; then
90 echo "workflow_dispatch stable releases require the version input." >&2
91 exit 1
92 fi
93 else
94 raw="${GITHUB_REF_NAME}"
95 fi
96
97 version="${raw#v}"
98 if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
99 echo "Invalid release version: $raw" >&2
100 exit 1
101 fi
102
103 echo "release_channel=stable" >> "$GITHUB_OUTPUT"
104 echo "version=$version" >> "$GITHUB_OUTPUT"
105 echo "tag=v$version" >> "$GITHUB_OUTPUT"
106 echo "name=T3 Code v$version" >> "$GITHUB_OUTPUT"
107 echo "cli_dist_tag=latest" >> "$GITHUB_OUTPUT"
108 if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
109 echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
110 echo "make_latest=true" >> "$GITHUB_OUTPUT"
111 else
112 echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
113 echo "make_latest=false" >> "$GITHUB_OUTPUT"
114 fi
115 fi
116
72 - name: Lint117 - name: Lint
73 run: bun run lint118 run: bun run lint
74 119
@@ -78,6 +123,14 @@ jobs: · 3 unmodified lines
78 - name: Test123 - name: Test
79 run: bun run test124 run: bun run test
80 125
126 - id: previous_tag
127 name: Resolve previous release tag
128 run: |
129 node scripts/resolve-previous-release-tag.ts \
130 --channel "${{ steps.release_meta.outputs.release_channel }}" \
131 --current-tag "${{ steps.release_meta.outputs.tag }}" \
132 --github-output
133
81 build:134 build:
82 name: Build ${{ matrix.label }}135 name: Build ${{ matrix.label }}
83 needs: preflight136 needs: preflight
@@ -206,16 +259,17 @@ jobs: · 122 unmodified lines
206 "release/*.AppImage" \259 "release/*.AppImage" \
207 "release/*.exe" \260 "release/*.exe" \
208 "release/*.blockmap" \261 "release/*.blockmap" \
209 "release/latest*.yml"; do262 "release/*.yml"; do
210 for file in $pattern; do263 for file in $pattern; do
211 cp "$file" release-publish/264 cp "$file" release-publish/
212 done265 done
213 done266 done
214 267
215 if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then268 if [[ "${{ matrix.platform }}" == "mac" && "${{ matrix.arch }}" != "arm64" ]]; then
216 if [[ -f release-publish/latest-mac.yml ]]; then269 shopt -s nullglob
217 mv release-publish/latest-mac.yml "release-publish/latest-mac-${{ matrix.arch }}.yml"270 for manifest in release-publish/*-mac.yml; do
218 fi271 mv "$manifest" "${manifest%.yml}-${{ matrix.arch }}.yml"
272 done
219 fi273 fi
220 274
221 - name: Upload build artifacts275 - name: Upload build artifacts
@@ -257,7 +311,7 @@ jobs: · 35 unmodified lines
257 run: bun run build --filter=@t3tools/web --filter=t3311 run: bun run build --filter=@t3tools/web --filter=t3
258 312
259 - name: Publish CLI package313 - name: Publish CLI package
260 run: node apps/server/scripts/cli.ts publish --tag latest --app-version "${{ needs.preflight.outputs.version }}" --verbose314 run: node apps/server/scripts/cli.ts publish --tag "${{ needs.preflight.outputs.cli_dist_tag }}" --app-version "${{ needs.preflight.outputs.version }}" --verbose
261 315
262 release:316 release:
263 name: Publish GitHub Release317 name: Publish GitHub Release
@@ -284,17 +338,42 @@ jobs: · 20 unmodified lines
284 338
285 - name: Merge macOS updater manifests339 - name: Merge macOS updater manifests
286 run: |340 run: |
287 node scripts/merge-mac-update-manifests.ts \341 shopt -s nullglob
288 release-assets/latest-mac.yml \342 for x64_manifest in release-assets/*-mac-x64.yml; do
289 release-assets/latest-mac-x64.yml343 arm64_manifest="${x64_manifest%-x64.yml}.yml"
290 rm -f release-assets/latest-mac-x64.yml344 if [[ -f "$arm64_manifest" ]]; then
345 node scripts/merge-mac-update-manifests.ts "$arm64_manifest" "$x64_manifest"
346 rm -f "$x64_manifest"
347 fi
348 done
291 349
292 - name: Publish release350 - name: Publish release
351 if: needs.preflight.outputs.previous_tag != ''
352 uses: softprops/action-gh-release@v2
353 with:
354 tag_name: ${{ needs.preflight.outputs.tag }}
355 target_commitish: ${{ needs.preflight.outputs.ref }}
356 name: ${{ needs.preflight.outputs.release_name }}
357 generate_release_notes: true
358 previous_tag: ${{ needs.preflight.outputs.previous_tag }}
359 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
360 make_latest: ${{ needs.preflight.outputs.make_latest }}
361 files: |
362 release-assets/*.dmg
363 release-assets/*.zip
364 release-assets/*.AppImage
365 release-assets/*.exe
366 release-assets/*.blockmap
367 release-assets/*.yml
368 fail_on_unmatched_files: true
369
370 - name: Publish first release
371 if: needs.preflight.outputs.previous_tag == ''
293 uses: softprops/action-gh-release@v2372 uses: softprops/action-gh-release@v2
294 with:373 with:
295 tag_name: ${{ needs.preflight.outputs.tag }}374 tag_name: ${{ needs.preflight.outputs.tag }}
296 target_commitish: ${{ needs.preflight.outputs.ref }}375 target_commitish: ${{ needs.preflight.outputs.ref }}
297 name: T3 Code v${{ needs.preflight.outputs.version }}376 name: ${{ needs.preflight.outputs.release_name }}
298 generate_release_notes: true377 generate_release_notes: true
299 prerelease: ${{ needs.preflight.outputs.is_prerelease }}378 prerelease: ${{ needs.preflight.outputs.is_prerelease }}
300 make_latest: ${{ needs.preflight.outputs.make_latest }}379 make_latest: ${{ needs.preflight.outputs.make_latest }}
@@ -304,11 +383,12 @@ jobs: · 3 unmodified lines
304 release-assets/*.AppImage383 release-assets/*.AppImage
305 release-assets/*.exe384 release-assets/*.exe
306 release-assets/*.blockmap385 release-assets/*.blockmap
307 release-assets/latest*.yml386 release-assets/*.yml
308 fail_on_unmatched_files: true387 fail_on_unmatched_files: true
309 388
310 finalize:389 finalize:
311 name: Finalize release390 name: Finalize release
391 if: needs.preflight.outputs.release_channel == 'stable'
312 needs: [preflight, release]392 needs: [preflight, release]
313 runs-on: ubuntu-24.04393 runs-on: ubuntu-24.04
314 timeout-minutes: 10394 timeout-minutes: 10