-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (131 loc) · 4.74 KB
/
release.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Wails build
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
env:
# Necessary for most environments as build failure can occur due to OOM issues
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
build:
strategy:
# Failure in one platform build won't impact the others
fail-fast: false
matrix:
build:
- platform: 'linux/amd64'
os: 'ubuntu-latest'
- platform: 'windows/amd64'
os: 'windows-latest'
- platform: 'darwin/universal'
os: 'macos-latest'
runs-on: ${{ matrix.build.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# Setup and configure GoLang
- name: Setup GoLang
uses: actions/setup-go@v4
with:
check-latest: true
go-version: '1.21'
- run: go version
shell: bash
# Setup and configure NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '16.x'
# Install Wails
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
shell: bash
- name: Install Linux Wails deps
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-0 libwebkit2gtk-4.0-dev gcc-aarch64-linux-gnu
shell: bash
- name: Install macOS Wails deps
if: runner.os == 'macOS'
run: brew install mitchellh/gon/gon
shell: bash
# Build
- name: Build App
if: runner.os == 'macOS'
run: wails build --platform ${{matrix.build.platform}} --nopackage -webview2 download -o scanoss-lui-macos
shell: bash
- name: Build Linux App
if: runner.os == 'Linux'
run: wails build --platform ${{matrix.build.platform}} -webview2 download -o scanoss-lui-linux
shell: bash
- name: Build Windows App
if: runner.os == 'Windows'
run: wails build --platform ${{matrix.build.platform}} -webview2 download -o scanoss-lui-windows.exe
shell: bash
# Set execution permissions
- name: Add macOS perms
if: runner.os == 'macOS'
run: chmod +x ./build/bin/scanoss-lui-macos
shell: bash
- name: Add Linux perms
if: runner.os == 'Linux'
run: chmod +x ./build/bin/scanoss-lui-linux
shell: bash
# macOS Signing
- name: Import Code-Signing Certificates for macOS
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/')
uses: Apple-Actions/import-codesign-certs@v1
with:
keychain-password: ${{ secrets.APPLE_PASSWORD }}
p12-file-base64: ${{ secrets.MACOS_DEVELOPER_CERT }}
p12-password: ${{ secrets.MACOS_DEVELOPER_CERT_PASSWORD }}
- name: Sign macOS binary
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/')
shell: bash
env:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_ID: [email protected]
APPLE_DEVELOPER_ID: ${{ secrets.MACOS_DEVELOPER_CERT_ID }}
APP_CERTIFICATE: ${{ secrets.MACOS_DEVELOPER_CERT_FULL_ID }}
run: |
echo "Signing Package"
codesign --timestamp --deep --options=runtime -s "$APP_CERTIFICATE" --verbose ./build/bin/scanoss-lui-macos
- name: Build macOS zip file
if: runner.os == 'macOS'
shell: bash
run: |
cd ./build/bin/ && zip scanoss-lui-macos.zip scanoss-lui-macos
- name: Build Linux zip file
if: runner.os == 'Linux'
shell: bash
run: |
cd ./build/bin/ && zip scanoss-lui-linux.zip scanoss-lui-linux
- name: Build Windows zip file
if: runner.os == 'Windows'
shell: powershell
run: |
cd ./build/bin/; Compress-Archive -Path scanoss-lui-windows.exe -Destination scanoss-lui-windows.zip
- name: Notarize
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/')
shell: bash
env:
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_ID: [email protected]
APPLE_DEVELOPER_ID: ${{ secrets.MACOS_DEVELOPER_CERT_ID }}
run: |
xcrun notarytool submit ./build/bin/scanoss-lui-macos.zip --apple-id "${APPLE_ID?}" --team-id "${APPLE_DEVELOPER_ID?}" --password "${APPLE_PASSWORD?}"
# Upload build assets
- uses: actions/upload-artifact@v4
with:
name: Wails Build ${{runner.os}}
path: |
*/bin/*.zip
*\bin\*.zip
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
*/bin/*.zip