forked from versustunez/VEQ
-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (144 loc) · 6.37 KB
/
release.yml
File metadata and controls
174 lines (144 loc) · 6.37 KB
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
name: Release
run-name: "Release"
on:
push:
tags:
- '**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
env:
BUILD_TYPE: Release
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CMAKE_BUILD_PARALLEL_LEVEL: 3
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libasound2-dev libjack-jackd2-dev ladspa-sdk libcurl4-openssl-dev libfreetype6-dev libx11-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxinerama-dev libxrandr-dev libxrender-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev mesa-common-dev
- name: Install macOS Deps
if: runner.os == 'macOS'
run: brew install osxutils
- name: Import Certificates (macOS)
uses: apple-actions/import-codesign-certs@v2 # only exists as a tag right now
if: runner.os == 'macOS'
with:
p12-file-base64: ${{ secrets.DEV_ID_APP_CERT }}
p12-password: ${{ secrets.DEV_ID_APP_PASSWORD }}
- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: 15.1
- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" .
- name: Build
shell: bash
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel 4
- name: Read in .env from CMake # see GitHubENV.cmake
shell: bash
run: |
cat .env
cat .env >> $GITHUB_ENV
- name: Set additional env vars for next steps
shell: bash
run: |
echo "ARTIFACTS_PATH=${{ env.BUILD_DIR }}/Plugin/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}" >> $GITHUB_ENV
echo "VST3_PATH=Plugin/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}/VST3/${{ env.PRODUCT_NAME }}.vst3" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-${{ runner.os }}" >> $GITHUB_ENV
- name: Codesign (macOS)
working-directory: ${{ env.BUILD_DIR }}
if: runner.os == 'macOS'
run: |
codesign --force -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" -v "${{ env.VST3_PATH }}" --deep --strict --options=runtime --timestamp
- name: Add Custom Icons (macOS)
if: runner.os == 'macOS'
working-directory: ${{ env.BUILD_DIR }}
run: |
# add the icns as its own icon resource (meta!)
sips -i ../packaging/veq.icns
# Grab the resource, put in tempfile
DeRez -only icns ../packaging/veq.icns > /tmp/icons
# Stuff the resource into the strange Icon? file's resource fork
Rez -a /tmp/icons -o "${{ env.VST3_PATH }}/Icon"$'\r'
# Set custom icon attribute
SetFile -a C "${{ env.VST3_PATH }}"
- name: Create DMG, Notarize and Staple (macOS)
if: runner.os == 'macOS'
run: |
python3 -m pip install setuptools # Workaround for Node-gyp issues installing appdmg
npm install -g appdmg
mkdir -p packaging/dmg
# Create directories for the dmg symlinks
sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/Components && sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/VST3
ln -s /Library/Audio/Plug-Ins/VST3 "packaging/dmg/Your Mac's VST3 folder"
mv "${{ env.ARTIFACTS_PATH }}/VST3/${{ env.PRODUCT_NAME }}.vst3" packaging/dmg
# Run appdmg to create the .dmg
cd packaging && appdmg dmg.json "${{ env.ARTIFACT_NAME}}.dmg"
codesign -s "${{ secrets.DEVELOPER_ID_APPLICATION}}" --timestamp -i ${{ env.BUNDLE_ID }} --force "${{ env.ARTIFACT_NAME }}.dmg"
xcrun notarytool submit "${{ env.ARTIFACT_NAME }}.dmg" --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.TEAM_ID }} --wait
xcrun stapler staple "${{ env.ARTIFACT_NAME }}.dmg"
- name: Zip
if: runner.os == 'Linux'
working-directory: ${{ env.ARTIFACTS_PATH }}
run: 7z a -tzip "${{ env.ARTIFACT_NAME }}.zip" ./VST3/${{ env.PRODUCT_NAME }}.vst3/
- name: Set path for candle and light
if: runner.os == 'Windows'
run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
shell: bash
- name: Generate Installer (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
cd packaging
heat.exe dir "../${{env.ARTIFACTS_PATH}}/VST3/${{ env.PRODUCT_NAME }}.vst3/" -cg ProductComponents -gg -sfrag -scom -nologo -sr -dr INSTALLFOLDER -out output.wxs
candle -dPRODUCT_NAME=${{env.PRODUCT_NAME}} -dVERSION=${{env.VERSION}} Product.wxs output.wxs -o obj/ -arch x64
light obj/*.wixobj -o "${{ env.ARTIFACT_NAME }}.msi" -b "../${{env.ARTIFACTS_PATH}}/VST3/${{ env.PRODUCT_NAME }}.vst3/"
- name: Upload Exe (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}.msi
path: 'packaging/${{ env.ARTIFACT_NAME }}.msi'
- name: Upload Zip (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}.zip
path: '${{ env.ARTIFACTS_PATH }}/${{ env.ARTIFACT_NAME }}.zip'
- name: Upload DMG (MacOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}.dmg
path: packaging/${{ env.ARTIFACT_NAME }}.dmg
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- name: Get Artifacts
uses: actions/download-artifact@v3
- name: Create Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
# download-artifact puts these files in their own dirs...
# Using globs sidesteps having to pass the version around
files: |
*/*.msi
*/*.zip
*/*.dmg