-
Notifications
You must be signed in to change notification settings - Fork 19
149 lines (122 loc) · 3.97 KB
/
osx.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: osx build
on:
workflow_call:
workflow_dispatch:
env:
BUILD_TYPES: ${{ (github.ref_name == 'develop' || github.ref_name == 'main') && 'release debug' || 'release debug' }}
BUILD_TESTING: ${{ (github.ref_name != 'main') && 'testing' || '' }}
jobs:
build-x64:
runs-on: [self-hosted, macos, x64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: bash osx/build-nzbget.sh x64 ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}
- name: Upload full build log on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: nzbget-osx-x64-build-log
path: build/*/build.log
retention-days: 5
- name: Rename build artifacts
if: github.ref_name != 'main' && github.ref_name != 'develop'
run: |
cd build
SUFFIX="${GITHUB_REF_NAME/\//-}"
for FILE in *.zip; do
[ -f $FILE ] || continue
NEW_FILE=${FILE/-bin-macos-x64/-$SUFFIX-bin-macos-x64}
mv $FILE $NEW_FILE
done
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: nzbget-osx-installers-x64
path: build/*.zip
retention-days: 5
build-universal:
runs-on: [self-hosted, macos, arm64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: bash osx/build-nzbget.sh universal ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}
- name: Upload full build log on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: nzbget-osx-universal-build-log
path: build/*/build.log
retention-days: 5
- name: Rename build artifacts
if: github.ref_name != 'main' && github.ref_name != 'develop'
run: |
cd build
SUFFIX="${GITHUB_REF_NAME/\//-}"
for FILE in *.zip; do
[ -f $FILE ] || continue
NEW_FILE=${FILE/-bin-macos-universal/-$SUFFIX-bin-macos-universal}
mv $FILE $NEW_FILE
done
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: nzbget-osx-installers-universal
path: build/*-universal*.zip
retention-days: 5
sign-universal:
runs-on: [self-hosted, macos, arm64]
needs: [build-universal]
if: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Sign and notarize
env:
NOTARIZE: ${{ vars.OSX_NOTARIZE }}
KEYCHAIN_PASSWORD: ${{ secrets.OSX_KEYCHAIN_PASSWORD }}
DEVELOPER_IDENTITY: ${{ secrets.OSX_DEVELOPER_IDENTITY }}
NOTARY_KEY_ID: ${{ secrets.OSX_NOTARY_KEY_ID }}
NOTARY_KEY_ISSUER: ${{ secrets.OSX_NOTARY_KEY_ISSUER }}
run: |
mkdir -p build
cp osx/sign/* build
cp nzbget-osx-installers-universal/*.zip build/
cd build
bash nzbget-sign.sh *.zip
- name: Upload signed build artifacts
uses: actions/upload-artifact@v4
with:
name: nzbget-osx-installers-universal-signed
path: build/*.dmg
retention-days: 5
combine-osx-artifacts:
runs-on: ubuntu-24.04
needs: [build-x64, sign-universal]
permissions:
actions: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Combine artifacts
run: |
mkdir -p nzbget-osx-installers
mv nzbget-osx-installers-x64/* nzbget-osx-installers
mv nzbget-osx-installers-universal-signed/* nzbget-osx-installers
- name: Upload combined build artifacts
uses: actions/upload-artifact@v4
with:
name: nzbget-osx-installers
path: nzbget-osx-installers/*
retention-days: 5
- name: Delete unneeded artifacts
uses: geekyeggo/delete-artifact@v4
with:
name: |
nzbget-osx-installers-x64
nzbget-osx-installers-universal
nzbget-osx-installers-universal-signed