-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (47 loc) · 1.46 KB
/
build-windows.yml
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
name: Windows build
on:
workflow_call:
inputs:
mode:
type: string
required: true
jobs:
build-windows:
runs-on: windows-latest
env:
XMAKE_GLOBALDIR: ${{ github.workspace }}/xmake-global
steps:
- name: Get current date as package key
id: cache_key
run: echo "key=$(date +'%W')" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: '2.9.5'
actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }}
- name: Update xmake repository
run: xmake repo --update
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Retrieve cached xmake dependencies
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Windows-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
- name: Configure xmake
run: xmake f -m ${{ inputs.mode }} --ccache=n -y
- name: Build
run: xmake
- name: Install
if: inputs.mode == 'release'
run: xmake i -o dist WhaleConnect
- name: Upload
if: inputs.mode == 'release'
uses: actions/upload-artifact@v4
with:
name: WhaleConnect-windows
path: dist