-
Notifications
You must be signed in to change notification settings - Fork 307
168 lines (148 loc) · 5.37 KB
/
00_build.yaml
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
160
161
162
163
164
165
166
167
168
name: Build LMS
# Test using act: act -W .github/workflows/00_build.yaml --pull=false
on:
workflow_dispatch:
inputs:
branch:
type: string
description: 'The branch from which to build from'
required: true
# TODO - make this dynamic, or something like https://dev.to/mrmike/github-action-handling-input-default-value-5f2g?
default: public/9.0
build_type:
type: choice
description: 'Is this a nightly or a release build?'
required: true
default: 'nightly'
options:
- nightly
- release
jobs:
mac:
name: Build LMS for Mac (MenuBar Item)
runs-on: macos-13
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
DEV_CERT_NAME: ${{ secrets.DEV_CERT_NAME }}
APPLE_ID: ${{ secrets.APPLE_ID }}
NOTARIZATION_PW: ${{ secrets.NOTARIZATION_PW }}
TEAM_ID: ${{ secrets.TEAM_ID }}
steps:
# we must check out here, as otherwise the build action is not available
- name: Check out LMS code
uses: actions/checkout@v4
with:
path: server
ref: ${{ inputs.branch }}
- name: Install the Apple certificate and provisioning profile
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Launch build process
uses: ./server/.github/actions/build
with:
build-params: macos
build-type: ${{ inputs.build_type }}
AWS_KEY_ID: ${{ secrets.R2_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
linux:
name: Build LMS for Linux
runs-on: ubuntu-22.04
strategy:
matrix:
flavour:
- [debian, "--x86_64"]
- [debian, "--arm"]
- [debian, "--i386"]
- [debian, ""]
- [rpm, ""]
- [tarball, "--arm"]
- [tarball, ""]
- [tarball, "--encore"]
- [tarball, "--noCPAN"]
steps:
# we must check out here, as otherwise the build action is not available
- name: Check out LMS code
uses: actions/checkout@v4
with:
path: server
ref: ${{ inputs.branch }}
- name: Prepare build environment
if: ${{ matrix.flavour[0] != 'tarball' }}
run: |
sudo apt update
sudo apt install apt-transport-https debhelper devscripts
- name: Launch build process
uses: ./server/.github/actions/build
with:
build-params: ${{ matrix.flavour[0] }} ${{ matrix.flavour[1] }}
build-type: ${{ inputs.build_type }}
AWS_KEY_ID: ${{ secrets.R2_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
docker:
name: Build LMS for Docker
runs-on: ubuntu-22.04
steps:
# we must check out here, as otherwise the build action is not available
- name: Check out LMS code
uses: actions/checkout@v4
with:
path: server
ref: ${{ inputs.branch }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Launch build process
uses: ./server/.github/actions/build
with:
build-params: docker
build-type: ${{ inputs.build_type }}
win64:
name: Build LMS for Windows (64-bit)
runs-on: windows-2022
steps:
# we must check out here, as otherwise the build action is not available
- name: Check out LMS code
uses: actions/checkout@v4
with:
path: server
ref: ${{ inputs.branch }}
- name: Launch build process
uses: ./server/.github/actions/build
with:
build-params: win64
build-type: ${{ inputs.build_type }}
AWS_KEY_ID: ${{ secrets.R2_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
updateRepoFile:
name: Trigger repository file update
if: ${{ success() && inputs.build_type == 'nightly' && github.repository_owner == 'LMS-Community' }}
runs-on: ubuntu-latest
timeout-minutes: 2
needs:
- mac
- linux
- win64
permissions:
actions: write
steps:
- env:
GH_TOKEN: ${{ secrets.DEPLOYMENT_KEY }}
run: gh workflow run update-server-repository.yml -R https://github.com/LMS-Community/lms-server-repository