-
Notifications
You must be signed in to change notification settings - Fork 65
117 lines (99 loc) · 3.66 KB
/
Copy pathtest-windows-build.yml
File metadata and controls
117 lines (99 loc) · 3.66 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
name: Test Windows Build
on:
push:
tags:
- 'test-windows-v*.*.*'
permissions:
contents: write
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
jobs:
build-windows:
name: Build (x86_64-pc-windows-msvc)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: 'v1'
key: 'windows-latest-x86_64-pc-windows-msvc'
workspaces: src-tauri -> target
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get linked dependency versions
id: dep-versions
shell: bash
run: |
SM_SHA=$(git -C libs/stream-monaco rev-parse HEAD)
MS_SHA=$(git -C libs/markstream-vue rev-parse HEAD)
echo "cache-key=${{ runner.os }}-x86_64-pc-windows-msvc-linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> $GITHUB_OUTPUT
- name: Cache linked dependencies
id: cache-linked-deps
uses: actions/cache@v4
with:
path: |
libs/stream-monaco/node_modules
libs/stream-monaco/dist
libs/markstream-vue/node_modules
libs/markstream-vue/packages/markdown-parser/node_modules
libs/markstream-vue/packages/markdown-parser/dist
libs/markstream-vue/packages/markstream-react/node_modules
libs/markstream-vue/packages/markstream-react/dist
key: ${{ steps.dep-versions.outputs.cache-key }}
- name: Build linked dependencies
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
shell: bash
run: |
pnpm --dir libs/stream-monaco install --frozen-lockfile
pnpm --dir libs/stream-monaco build
pnpm --dir libs/markstream-vue install --frozen-lockfile
pnpm --dir libs/markstream-vue run build:parser
pnpm --dir libs/markstream-vue/packages/markstream-react build
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile
- name: Build with Tauri
uses: tauri-apps/tauri-action@v0
env:
NODE_OPTIONS: '--max_old_space_size=4096'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
tagName: ${{ github.ref_name }}
releaseName: 'AQBot Test ${{ github.ref_name }}'
releaseDraft: true
prerelease: true
tauriScript: pnpm tauri
args: --target x86_64-pc-windows-msvc
- name: Package Windows portable (zip)
shell: pwsh
run: |
$exe = "src-tauri/target/x86_64-pc-windows-msvc/release/AQBot.exe"
$zipName = "AQBot_${{ github.ref_name }}_windows-x64-portable.zip"
Compress-Archive -Path $exe -DestinationPath $zipName
- name: Upload Windows portable to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
files: AQBot_${{ github.ref_name }}_windows-x64-portable.zip