History

perf(ci): speed up release builds and Windows packaging (#7975)

Theo Browne committed 2 months ago

Commit 25dcee01 parent f70eeee6 files · +251 −120Browse files

Showing the changes to .github (1 of 6 files). Show all

Unified · Split

.github/workflows/release.yml+63−19
@@ -100,9 +100,6 @@ jobs: · 99 unmodified lines
100100 cache: true
101101 run-install: true
102102
103− - name: Ensure Electron runtime is installed
104− run: vp run --filter @t3tools/desktop ensure:electron
105−
106103 - id: release_meta
107104 name: Resolve release version
108105 shell: bash
@@ -157,6 +154,40 @@ jobs: · 48 unmodified lines
157154 fi
158155 fi
159156
157+ - id: previous_tag
158+ name: Resolve previous release tag
159+ run: |
160+ node scripts/resolve-previous-release-tag.ts \
161+ --channel "${{ steps.release_meta.outputs.release_channel }}" \
162+ --current-tag "${{ steps.release_meta.outputs.tag }}" \
163+ --github-output
164+
165+ quality:
166+ name: Release quality checks
167+ needs: [preflight]
168+ if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
169+ runs-on: blacksmith-8vcpu-ubuntu-2404
170+ timeout-minutes: 10
171+ steps:
172+ - name: Checkout
173+ uses: actions/checkout@v6
174+ with:
175+ ref: ${{ needs.preflight.outputs.ref }}
176+ sparse-checkout: |
177+ /*
178+ !/.repos/
179+ sparse-checkout-cone-mode: false
180+
181+ - name: Setup Vite+
182+ uses: voidzero-dev/setup-vp@v1
183+ with:
184+ node-version-file: package.json
185+ cache: true
186+ run-install: true
187+
188+ - name: Ensure Electron runtime is installed
189+ run: vp run --filter @t3tools/desktop ensure:electron
190+
160191 - name: Check
161192 run: vp check
162193
@@ -166,14 +197,6 @@ jobs: · 3 unmodified lines
166197 - name: Test
167198 run: vp run test
168199
169− - id: previous_tag
170− name: Resolve previous release tag
171− run: |
172− node scripts/resolve-previous-release-tag.ts \
173− --channel "${{ steps.release_meta.outputs.release_channel }}" \
174− --current-tag "${{ steps.release_meta.outputs.tag }}" \
175− --github-output
176−
177200 relay_public_config:
178201 name: Resolve T3 Connect public config
179202 needs: preflight
@@ -385,14 +408,34 @@ jobs: · 205 unmodified lines
385408 uses: voidzero-dev/setup-vp@v1
386409 with:
387410 node-version-file: package.json
388− cache: true
389− run-install: |
390− args:
391− - --filter=@t3tools/desktop...
392− - --filter=t3...
393− - --filter=@t3tools/scripts...
411+ cache: ${{ matrix.platform != 'win' }}
412+ run-install: false
413+
414+ - name: Resolve Windows package cache path
415+ if: matrix.platform == 'win'
416+ id: package_cache_path
417+ shell: pwsh
418+ run: '"path=$(vp pm cache dir)" >> $env:GITHUB_OUTPUT'
419+
420+ - name: Cache Windows packages
421+ if: matrix.platform == 'win'
422+ uses: actions/cache@v6
423+ with:
424+ path: ${{ steps.package_cache_path.outputs.path }}
425+ key: windows-release-packages-v1-${{ matrix.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
426+
427+ - name: Install desktop dependencies
428+ run: vp install --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
429+
430+ - name: Cache resource monitor
431+ id: resource_monitor_cache
432+ uses: actions/cache@v6
433+ with:
434+ path: native/resource-monitor/target/${{ matrix.rust_target }}/release/t3-resource-monitor${{ matrix.platform == 'win' && '.exe' || '' }}
435+ key: resource-monitor-${{ matrix.rust_target }}-${{ hashFiles('native/resource-monitor/Cargo.lock', 'native/resource-monitor/Cargo.toml', 'native/resource-monitor/src/**') }}
394436
395437 - name: Setup Rust
438+ if: steps.resource_monitor_cache.outputs.cache-hit != 'true'
396439 uses: dtolnay/rust-toolchain@stable
397440 with:
398441 targets: ${{ matrix.rust_target }}
@@ -518,6 +561,7 @@ jobs: · 119 unmodified lines
518561 - name: Build desktop artifact
519562 shell: bash
520563 env:
564+ T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: ${{ steps.resource_monitor_cache.outputs.cache-hit == 'true' }}
521565 CSC_LINK: ${{ secrets.CSC_LINK }}
522566 CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
523567 APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
@@ -664,8 +708,8 @@ jobs: · 140 unmodified lines
664708
665709 publish_cli:
666710 name: Publish CLI to npm
667− needs: [preflight, relay_public_config, build]
668− if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.build.result == 'success' }}
711+ needs: [preflight, relay_public_config, quality, build]
712+ if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.build.result == 'success' }}
669713 runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404
670714 timeout-minutes: 10
671715 permissions: