-
Notifications
You must be signed in to change notification settings - Fork 15
251 lines (215 loc) · 8.5 KB
/
Create_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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Create Release
env:
project: PopH264
on:
#pull_request:
workflow_dispatch:
push:
branches:
- master
- '*Test*'
#gr: testing, but cannot have path AND branch
#paths:
#- '**.json'
#tsdk: need this otherwise it will never make a package later on
tags:
- v*
watch:
types: [started]
jobs:
Build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runs_on }}
strategy:
matrix:
config:
- name: Linux x64
runs_on: ubuntu-latest
linux_target: linux
arch: x86_64
#- os: ubuntu-latest
# type: Wasm
# nvidia temporarily disabled... compiler out of date?
#- name: Nvidia Linux
# runs_on: Nvidia
# linux_target: Nvidia
# arch: arm64
# - name: Pi4
# runs_on: Raspberry Pi
# linux_target: pi
# arch: arm64
- name: Windows Dll x64
runs_on: windows-latest
BuildPlatform: x64
BuildConfiguration: Release
OutputDirectory: Windows/PopH264_Release_x64
- name: Windows Static x64
runs_on: windows-latest
BuildPlatform: x64
BuildConfiguration: Static
OutputDirectory: Windows/PopH264_Static_x64
- name: Windows Uwp x64
runs_on: windows-latest
BuildPlatform: "x64 Uwp" # Solution platform
BuildConfiguration: Release
OutputDirectory: Windows/PopH264_Uwp_Release_x64
- name: Windows Uwp Arm64
runs_on: windows-latest
BuildPlatform: "ARM64 Uwp" # solution platform
BuildConfiguration: Release
OutputDirectory: Windows/PopH264_Uwp_Arm64
- name: Windows Uwp Arm
runs_on: windows-latest
BuildPlatform: "ARM Uwp" # solution platform
BuildConfiguration: Release
OutputDirectory: Windows/PopH264_Uwp_Arm
- name: Apple Universal
runs_on: macos-12
scheme: PopH264_Universal
destination: "platform=macOS" # has no effect, but gets passed to xcodebuild so will fail if empty (todo: fix in action!)
- name: Ios Framework
runs_on: macos-latest
scheme: PopH264_Ios
destination: "generic/platform=iOS"
- name: Tvos Static
runs_on: macos-latest
scheme: PopH264_TvosStatic
destination: "generic/platform=tvOS"
- name: Macos Static
runs_on: macos-latest
scheme: PopH264_MacosStatic
destination: "generic/platform=macOS"
- name: Macos Dylib
runs_on: macos-latest
scheme: PopH264_MacosDylib
destination: "generic/platform=macOS"
- name: Android
runs_on: ubuntu-latest
type: Android
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure Windows
if: matrix.config.BuildConfiguration != ''
uses: microsoft/[email protected]
- name: Build Windows ${{ matrix.config.BuildConfiguration }}
id: Windows
if: matrix.config.BuildConfiguration != ''
uses: NewChromantics/[email protected]
with:
BuildSolution: PopH264.visualstudio/PopH264.sln
BuildPlatform: ${{ matrix.config.BuildPlatform }}
BuildConfiguration: ${{ matrix.config.BuildConfiguration }}
OutputDirectory: ${{ github.workspace }}\${{ matrix.config.OutputDirectory }}\ # need an absolute path here, must end with trailing slash
- name: "Import Apple-Distriubution NewChromantics Signing Certificate"
if: matrix.config.scheme != ''
uses: NewChromantics/[email protected]
with:
certificate-data: ${{ secrets.APPLE_DIST_NEWCHROMANTICS_P12 }}
certificate-passphrase: ${{ secrets.APPLE_DIST_NEWCHROMANTICS_PASSWORD }}
keychain-password: "Hello"
- name: Build Apple ${{matrix.config.scheme}}
id: Apple
if: matrix.config.scheme != ''
uses: NewChromantics/[email protected]
with:
BuildScheme: ${{matrix.config.scheme}}
project: ${{ env.project }}
destination: ${{ matrix.config.destination }}
- name: Build Linux ${{ matrix.config.linux_target }}
id: Linux
if: matrix.config.linux_target != ''
uses: NewChromantics/[email protected]
with:
os: ${{ matrix.config.linux_target }}
project: ${{ env.project }}
arch: ${{ matrix.config.arch }}
- name: Build Android Lib
id: Android
if: matrix.config.type == 'Android'
uses: NewChromantics/[email protected]
with:
buildtargetname: ${{ env.project }}
buildpath: ${{ env.project }}.Android/lib${{ env.project }}
- name: Wasm setup emscripten
if: matrix.config.type == 'Wasm'
uses: mymindstorm/setup-emsdk@v7
with:
version: "latest" #"1.39.15"
- name: Build Wasm
id: Wasm
if: matrix.config.type == 'Wasm'
env:
BUILD_TARGET_NAME: PopH264
run: PopH264.Emscripten/Build.sh PopH264.Emscripten/ release
- name: Wasm set artifact output vars
if: matrix.config.type == 'Wasm'
run: |
echo "UPLOAD_NAME=PopH264.Wasm" >> $GITHUB_OUTPUT
echo "UPLOAD_DIR=PopH264.Emscripten/Build" >> $GITHUB_OUTPUT
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
#name: ${{ steps.Windows.outputs.UPLOAD_NAME }}
name: ${{ matrix.config.name }}
path: ${{ steps.Windows.outputs.UPLOAD_DIR || steps.Linux.outputs.UPLOAD_DIR || steps.Android.outputs.UPLOAD_DIR || steps.Apple.outputs.UPLOAD_DIR }}
if-no-files-found: error
publish-gpr:
needs: Build
runs-on: ubuntu-latest
steps:
# Download project still, for package meta mostly (don't need submodules)
- name: Checkout repo for packaging
uses: actions/checkout@v2
# Download ALL artifacts into Packaging dir
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
path: ${{ env.project }}.Package/
# copy files we want in the release/package into the package dir
# we use this to collate ALL the final files!
- name: Copy files for packaging
run: |
echo Copying files into $PACKAGE_DIR
echo Project is ${{ env.project }}
cp Readme.md $PACKAGE_DIR
cp Source_CSharp/* $PACKAGE_DIR
rsync -avP --exclude PopH264.xcframework/* $PACKAGE_DIR
env:
PACKAGE_DIR: ${{ env.project }}.Package/
# Disabled for now as its giving the error
# PopH264.Package/PopH264.xcframework/macos-x86_64/PopH264_Osx.framework: bundle format is ambiguous (could be app or framework)
# - name: Test xcframework code signing
# run: |
# codesign -vvvv ${{ env.project }}.Package/${{ env.project }}.xcframework/macos-x86_64/${{ env.project }}_Osx.framework
# setup node for npm packaging
- name: Make github package
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
# set dry-run if this isn't a tag so npm publish will run, but not do anything (and not fail)
- name: Set npm publish as dry-run
if: startsWith(github.ref, 'refs/tags/v') != true
run: echo "NPM_PACKAGE_DRY_RUN=--dry-run" >> $GITHUB_ENV
# copy files we want to
# download github-publish dependencies (ci), then publish from package dir
- name: Publish
working-directory: ${{ env.project }}.Package/
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
ls
npm publish $NPM_PACKAGE_DRY_RUN
# make a release
# needs to be after the npm package cause this step tars and deletes all the files in the dir which breaks it!
- name: Make github release
# only try and make a release if this is a release (to help testing npm packaging)
if: startsWith(github.ref, 'refs/tags/v')
uses: fnkr/github-action-ghr@v1
env:
GHR_COMPRESS: zip
GHR_PATH: ${{ env.project }}.Package/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}