-
Notifications
You must be signed in to change notification settings - Fork 478
159 lines (137 loc) · 5.07 KB
/
main.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
150
151
152
153
154
155
156
157
158
159
name: CI/CD Pipeline
on:
push:
branches:
- develop
- main
- feat-*
- beta-*
- wip-*
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "21.6.2"
- name: Enable Corepack
run: corepack enable
- name: Install Dependencies
run: |
yarn
- name: Test
run: |
yarn test
deploy:
needs: test
runs-on: ${{ matrix.os }}
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/beta-') || startsWith(github.ref, 'refs/heads/feat-') || startsWith(github.ref, 'refs/heads/wip-')
strategy:
matrix:
include:
- name: mac
label: macOS ARM
os: macos-14
- name: mac-intel
label: macOS Intel
os: macos-14
- name: win32
label: Windows 32-bit
os: ubuntu-latest
- name: win64
label: Windows 64-bit
os: ubuntu-latest
- name: linux
label: Linux
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "21.6.2"
- name: Enable Corepack
run: corepack enable
- name: Setup codesign certificate
if: (matrix.name == 'mac') || (matrix.name == 'mac-intel')
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 -i - --decode > certificate.p12
security create-keychain -p "$KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PWD" build.keychain
- name: Install Dependencies
run: |
yarn
- name: Update credits
env:
PATREON_ACCESS_TOKEN: ${{ secrets.PATREON_ACCESS_TOKEN }}
PATREON_CAMPAIGN_ID: ${{ secrets.PATREON_CAMPAIGN_ID }}
run: |
npm run fetch-contributors
npm run fetch-patrons
# ==== Builds ====
- name: Build Mac ARM
if: matrix.name == 'mac'
env:
APPLE_ID: ${{ secrets.MAC_NOTARIZE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.MAC_NOTARIZE_PWD }}
APPLE_TEAM_ID: ${{ secrets.MAC_NOTARIZE_TEAM }}
run: |
export APPLE_ID=${APPLE_ID}
export APPLE_ID_PASSWORD=${APPLE_ID_PASSWORD}
export APPLE_TEAM_ID=${APPLE_TEAM_ID}
yarn make:mac
mkdir -p ./out/keep
mv ./out/make/zip/darwin/arm64/*.zip ./out/keep/gb-studio-${GITHUB_REF##*/}-darwin_arm64.zip
- name: Build Mac Intel
if: matrix.name == 'mac-intel'
env:
APPLE_ID: ${{ secrets.MAC_NOTARIZE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.MAC_NOTARIZE_PWD }}
APPLE_TEAM_ID: ${{ secrets.MAC_NOTARIZE_TEAM }}
run: |
export APPLE_ID=${APPLE_ID}
export APPLE_ID_PASSWORD=${APPLE_ID_PASSWORD}
export APPLE_TEAM_ID=${APPLE_TEAM_ID}
yarn make:mac-intel
mkdir -p ./out/keep
mv ./out/make/zip/darwin/x64/*.zip ./out/keep/gb-studio-${GITHUB_REF##*/}-darwin_x64.zip
- name: Build Linux
if: matrix.name == 'linux'
run: |
yarn make:linux
mkdir -p ./out/keep
mv ./out/make/deb/x64/*.deb ./out/keep/gb-studio-${GITHUB_REF##*/}-linux_x86_64.deb
mv ./out/make/rpm/x64/*.rpm ./out/keep/gb-studio-${GITHUB_REF##*/}-linux_x86_64.rpm
mv ./out/make/AppImage/x64/*.AppImage ./out/keep/gb-studio-${GITHUB_REF##*/}-linux_x86_64.AppImage
- name: Build Win32
if: matrix.name == 'win32'
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install wine wine64 mono-devel
yarn make:win32
mkdir -p ./out/keep
mv ./out/make/zip/win32/ia32/*.zip ./out/keep/gb-studio-${CIRCLE_BRANCH}-windows_x86.zip
mv ./out/make/squirrel.windows/ia32 ./out/keep/gb-studio-${CIRCLE_BRANCH}-windows_x86-squirrel
- name: Build Win64
if: matrix.name == 'win64'
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install wine wine64 mono-devel
yarn make:win
mkdir -p ./out/keep
mv ./out/make/zip/win32/x64/*.zip ./out/keep/gb-studio-${CIRCLE_BRANCH}-windows_x86_64.zip
mv ./out/make/squirrel.windows/x64 ./out/keep/gb-studio-${CIRCLE_BRANCH}-windows_x86_64-squirrel
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.label }} build
path: |
./out/keep/**