forked from mtoyoda/sl
-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (51 loc) · 1.88 KB
/
Copy pathwin-build.yml
File metadata and controls
54 lines (51 loc) · 1.88 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
name: Windows Build SL
on:
workflow_call:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
target: [aarch64, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Cargo Registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Install NSIS
run: |
winget install --id NSIS.NSIS --silent --accept-source-agreements --accept-package-agreements
if (Test-Path "C:\Program Files (x86)\NSIS") {
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\NSIS"
} elseif (Test-Path "C:\Program Files\NSIS") {
Add-Content $env:GITHUB_PATH "C:\Program Files\NSIS"
}
shell: pwsh
- name: Install toolchain
run: rustup target install ${{ matrix.target }}-pc-windows-msvc
- name: Build Debug
run: cargo build --target=${{ matrix.target }}-pc-windows-msvc
- name: Build Release
run: cargo build --target=${{ matrix.target }}-pc-windows-msvc --release
- name: Build and Process Installer
id: installer_build
working-directory: ${{github.workspace}}/target
shell: bash
run: |
cmake .. -DARCH="${{ matrix.target }}"
cpack -C Release
if [ "${{ matrix.target }}" == "aarch64" ]; then
INSTALLER=$(ls sl-*.exe)
NEW_INSTALLER=$(echo $INSTALLER | sed 's/win64/woa64/')
mv $INSTALLER $NEW_INSTALLER
fi
INSTALLER=$(ls sl-*.exe)
echo "installer=${INSTALLER}" >> $GITHUB_OUTPUT
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{ steps.installer_build.outputs.installer }}
path: target/${{ steps.installer_build.outputs.installer }}