-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (68 loc) · 2.24 KB
/
build_mac.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
60
61
62
63
64
65
66
67
68
69
70
71
name: Build for Mac
on:
workflow_dispatch:
workflow_call:
inputs:
upload:
required: true
type: boolean
VERSION_NO:
required: true
type: string
unit_test:
type: boolean
default: false
outputs:
ARCHIVE_NAME:
value: ${{ jobs.build-for-mac.outputs.ARCHIVE_NAME }}
jobs:
build-for-mac:
runs-on: macos-latest
outputs:
ARCHIVE_NAME: ${{ steps.build.outputs.ARCHIVE_NAME }}
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.8.1'
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qt5compat qthttpserver qtimageformats qtscxml qtshadertools qtwebsockets'
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Build for Mac
id: build
env:
VERSION_NO: ${{ inputs.VERSION_NO }}
run: |
echo "::group::Build hagoromo"
echo "#ifndef ENCRYPTION_SEED_H" > ./lib/tools/encryption_seed.h
echo "#define ENCRYPTION_SEED_H" >> ./lib/tools/encryption_seed.h
echo "#define ENCRYPT_SEED \"${{ secrets.HAGOROMO_ENCRYPT_SEED_FOR_MAC }}\"" >> ./lib/tools/encryption_seed.h
echo "#endif // ENCRYPTION_SEED_H" >> ./lib/tools/encryption_seed.h
./scripts/build.sh mac ${QT_ROOT_DIR}/bin
echo "::endgroup::"
# echo "Make for Mac"
# mkdir -p deploy-hagoromo/hagoromo
# echo "for mac" > deploy-hagoromo/hagoromo/hagoromo.txt
# cd deploy-hagoromo
# zip -r hagoromo_${VERSION_NO}_mac.zip hagoromo/
# cd ..
ls -l deploy-hagoromo
echo "ARCHIVE_NAME=hagoromo_${VERSION_NO}_mac.zip" >> "$GITHUB_OUTPUT"
- name: Upload a archive
if: ${{ inputs.upload == true }}
uses: actions/upload-artifact@v4
with:
name: archive_for_mac
path: "deploy-hagoromo/${{ steps.build.outputs.ARCHIVE_NAME }}"
- name: Unit test
if: ${{ inputs.unit_test == true }}
env:
TZ: "Asia/Tokyo"
run: scripts/unittest.sh mac ${QT_ROOT_DIR}/bin