-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (138 loc) · 6.58 KB
/
workflow.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
name: CMake
on: [push, pull_request]
env:
BUILD_TYPE: Release
BUNDLE_ID: com.mach1.notepad
VERSION: 1.0.2
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-2019]
steps:
- name: Set up custom git config
if: runner.os == 'Windows'
run: git config --global core.compression 0
- name: Set up custom git config (2)
if: runner.os == 'Windows'
run: git config --global http.postBuffer 524288000
- uses: actions/checkout@v4
- name: Submodule JUCE
uses: actions/checkout@v4
with:
repository: juce-framework/JUCE
path: JUCE
ref: '8.0.0'
fetch-depth: 1
# TODO: Change to allow for windows too after resolving pull errors on github actions
- name: Submodule JUCE_deps
if: runner.os == 'MacOS'
uses: actions/checkout@v4
with:
repository: Mach1Studios/m1-juce-deps
path: JUCE_deps
ssh-key: ${{ secrets.HIMWHO_SSH_KEY }}
lfs: true
fetch-depth: 1
# TODO: Consolidate this by figuring out how to path to a universal .workspace
- name: Create Build Environment (macos)
if: runner.os == 'MacOS'
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Create Build Environment (windows)
if: runner.os == 'Windows'
run: cmake -E make_directory ${{ runner.workspace }}/build
- name: Configure CMake (macos)
if: runner.os == 'MacOS'
working-directory: ${{ github.workspace }}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Configure CMake (windows)
if: runner.os == 'Windows'
shell: bash
working-directory: ${{ runner.workspace }}/build
run: cmake $GITHUB_WORKSPACE -A x64 -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build (macos)
if: runner.os == 'MacOS'
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Build (windows)
if: runner.os == 'Windows'
working-directory: ${{ runner.workspace }}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
# - name: Codesign (macos)
# if: runner.os == 'MacOS'
# env:
# DIST_DIR: ${{ github.workspace }}/build/M1-Notepad_artefacts/Release
# WRAPTOOL: ${{ github.workspace }}/JUCE_deps/PACEAntiPiracy_MAC/Eden/Fusion/Versions/5/bin/wraptool
# PACE_ID: ${{ secrets.PACE_ID }}
# WRAP_GUID: ${{ secrets.M1_GLOBAL_GUID }}
# APPLE_CODESIGN_ID: ${{ secrets.APPLE_CODESIGN_ID }}
# run: |
# $WRAPTOOL sign --verbose --account $PACE_ID --wcguid $WRAP_GUID --signid $APPLE_CODESIGN_ID --in ${DIST_DIR}/AAX/M1-Notepad.aaxplugin --out ${DIST_DIR}/AAX/M1-Notepad.aaxplugin
- name: Package (macos)
if: runner.os == 'MacOS'
working-directory: ${{ github.workspace }}/build
shell: bash
env:
DIST_DIR: ${{ github.workspace }}/build/M1-Notepad_artefacts/Release
INSTALL_DIR: /Library/Audio/Plug-Ins
AAX_INSTALL_DIR: /Library/Application\ Support/Avid/Audio/Plug-Ins
BUNDLE_ID: ${{ env.BUNDLE_ID }}
VERSION: ${{ env.VERSION }}
MACOS_CERTIFICATE: ${{ secrets.DEV_ID_APP_CERT }}
MACOS_INSTALLER_CERT: ${{ secrets.DEV_ID_INST_CERT }}
MACOS_CERTIFICATE_PWD: ${{ secrets.DEV_ID_CERT_PASSWORD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
echo $MACOS_INSTALLER_CERT | base64 --decode > installer.p12
RANDOM_PWD=`date | md5`
security create-keychain -p ${RANDOM_PWD} build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p ${RANDOM_PWD} build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security import installer.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/productbuild
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${RANDOM_PWD} build.keychain
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/AU/M1-Notepad.component -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/VST3/M1-Notepad.vst3 -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/AAX/M1-Notepad.aaxplugin -v
pkgbuild --identifier ${BUNDLE_ID}.au --version ${VERSION} --component ${DIST_DIR}/AU/M1-Notepad.component \
--install-location "${INSTALL_DIR}/Components" ${DIST_DIR}/M1-Notepad.au.pkg
pkgbuild --identifier ${BUNDLE_ID}.vst3 --version ${VERSION} --component ${DIST_DIR}/VST3/M1-Notepad.vst3 \
--install-location "${INSTALL_DIR}/VST3" ${DIST_DIR}/M1-Notepad.vst3.pkg
productbuild --synthesize \
--package "${DIST_DIR}/M1-Notepad.au.pkg" \
--package "${DIST_DIR}/M1-Notepad.vst3.pkg" \
distribution.xml
productbuild --sign "Developer ID Installer" --distribution distribution.xml --package-path ${DIST_DIR} ${DIST_DIR}/M1-Notepad.pkg
# - name: Codesign (windows)
# if: runner.os == 'Windows'
# shell: bash
# env:
# DIST_DIR: ${{ runner.workspace }}\build\M1-Notepad_artefacts\Release
# WRAPTOOL: ${{ runner.workspace }}\JUCE_deps/PACEAntiPiracy_WIN/Eden/Fusion/Versions/5/wraptool.exe
# PACE_ID: ${{ secrets.PACE_ID }}
# WRAP_GUID: ${{ secrets.M1_GLOBAL_GUID }}
# WIN_SIGNTOOL_ID: ${{ secrets.WIN_SIGNTOOL_ID }}
# run: $WRAPTOOL sign --verbose --account $PACE_ID --wcguid $WRAP_GUID --signid $WIN_SIGNTOOL_ID --in ${DIST_DIR}\AAX\M1-Notepad.aaxplugin --out ${DIST_DIR}\AAX\M1-Notepad.aaxplugin --autoinstall on
- name: InnoSetup Installer (windows)
if: runner.os == 'Windows'
working-directory: ${{ runner.workspace }}/build
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" /DBuildDir="$GITHUB_WORKSPACE\build\M1-Notepad_artefacts\Release" "$GITHUB_WORKSPACE\M1-Notepad\Resources\InnoSetup.iss"
shell: cmd
- name: 'Upload Artifact (macos)'
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v2
with:
name: M1-Notepad (MacOS)
path: ${{ github.workspace }}/build/M1-Notepad_artefacts/Release/M1-Notepad.pkg
if-no-files-found: error
- name: 'Upload Artifact (windows)'
if: runner.os == 'Windows'
uses: actions/upload-artifact@v2
with:
name: M1-Notepad (Windows)
path: ${{ runner.workspace }}\build\M1-Notepad_artefacts\Release\Output\M1-Notepad_WIN.exe
if-no-files-found: error