-
Notifications
You must be signed in to change notification settings - Fork 2
144 lines (121 loc) · 4.41 KB
/
windows.yml
File metadata and controls
144 lines (121 loc) · 4.41 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
name: windows
on:
workflow_dispatch:
inputs:
profile:
description: 'Build profile (release or fast)'
required: false
default: 'fast'
type: choice
options:
- fast
- release
push:
branches:
- main
tags:
- "v*"
pull_request:
permissions:
contents: write
jobs:
unit_windows:
name: unit (windows)
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install
run: npm ci
- name: Release version consistency
run: npm run release:check-version
- name: Unit tests
run: npm run test:unit
- name: Command surface drift check
run: npm run check:command-surface
tauri_windows:
name: tauri build (windows)
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
runs-on: windows-latest
timeout-minutes: 60
needs: [unit_windows]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Determine release version
id: release_version
run: node scripts/tauri/get-release-version.js
- name: Resolve bundled Node version
id: bundled_node_version
shell: pwsh
run: |
$nodeVersion = node -p "process.version"
"value=$nodeVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "src-tauri -> target"
- name: Cache packaged backend production deps
uses: actions/cache@v4
with:
path: |
src-tauri/resources/backend/node_modules
src-tauri/resources/backend/.prod-install-stamp.json
key: ${{ runner.os }}-tauri-backend-prod-v2-${{ steps.bundled_node_version.outputs.value }}-${{ hashFiles('.nvmrc', 'package.json', 'package-lock.json', 'scripts/tauri/prepare-backend-resources.js') }}
- name: Install
run: npm ci
- name: Sync release versions
run: npm run release:sync-version
- name: Release version consistency
run: npm run release:check-version
- name: Determine build profile
id: build_profile
shell: pwsh
run: |
$profile = "${{ github.event.inputs.profile }}"
if (-not $profile -or $profile -eq '') { $profile = 'release' }
"value=$profile" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
$targetDir = if ($profile -eq 'fast') { 'fast' } else { 'release' }
"target_dir=$targetDir" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Build Windows installer (Tauri)
run: |
node scripts/tauri/run-tauri-build.js --profile ${{ steps.build_profile.outputs.value }}
- name: Upload installer artifacts
uses: actions/upload-artifact@v4
with:
name: tauri-windows-bundle
if-no-files-found: error
path: |
src-tauri/target/${{ steps.build_profile.outputs.target_dir }}/bundle/msi/*.msi
src-tauri/target/${{ steps.build_profile.outputs.target_dir }}/bundle/nsis/*.exe
- name: Create GitHub Release (tags only)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Agent Workspace ${{ steps.release_version.outputs.value }}
# Only one workflow should own generated release notes for a tag.
generate_release_notes: true
files: |
src-tauri/target/${{ steps.build_profile.outputs.target_dir }}/bundle/msi/*.msi
src-tauri/target/${{ steps.build_profile.outputs.target_dir }}/bundle/nsis/*.exe
- name: Append release install notes (tags only)
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
node scripts/release/append-release-install-notes.js --tag ${{ github.ref_name }}