-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (85 loc) · 3.14 KB
/
build.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: build
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: build-${{ github.ref }}
jobs:
package:
strategy:
matrix:
platform: [windows-latest, macos-latest]
go-version: [1.21]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
# wails.jsonでフロントエンドのビルドおよびインストールコマンドを設定していない場合、ここで手動でフロントエンドをビルドする必要があるかもしれません。
- name: Get Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get NSIS
if: matrix.platform == 'windows-latest'
run: |
choco install nsis
- name: Build Wails app for macOS
if: matrix.platform == 'macos-latest'
run: |
wails build -platform darwin/universal -clean
- name: Build Wails app for Windows
if: matrix.platform == 'windows-latest'
run: |
wails build -nsis -clean
- name: Import codesign certs
if: matrix.platform == 'macos-latest'
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_CERT_DATA }}
p12-password: ${{ secrets.APPLE_CERT_PASSWORD }}
- name: Codesign app
if: matrix.platform == 'macos-latest'
run: |
codesign --deep --force -v -s "${{secrets.APPLE_SIGN_IDENTITY}}" -o runtime --timestamp build/bin/SIMAppletManager.app
- name: Create DMG
if: matrix.platform == 'macos-latest'
run: |
npm i -g create-dmg
mkdir -p build/dmg
create-dmg build/bin/SIMAppletManager.app --dmg-title=SIMAppletManager build/dmg/
mv build/dmg/*.dmg build/dmg/SIMAppletManager.dmg
- name: Notarize DMG
if: matrix.platform == 'macos-latest'
run: |
xcrun notarytool submit \
--team-id '${{ secrets.APPLE_TEAM_ID }}' \
--apple-id '${{ secrets.APPLE_USERNAME }}' \
--password "${{ secrets.APPLE_PASSWORD }}" \
--wait \
build/dmg/SIMAppletManager.dmg
- name: Staple DMG
if: matrix.platform == 'macos-latest'
run: |
DMG="$(ls build/dmg/)"
xcrun stapler staple build/dmg/SIMAppletManager.dmg
- name: upload artifacts macOS
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: sim-applet-manager-macos
path: build/dmg/*
- name: upload artifacts windows
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: sim-applet-manager-windows
path: build/bin/SIMAppletManager-amd64-installer.exe