-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (152 loc) · 5.74 KB
/
ci.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
name: CI
on: [push, pull_request]
env:
# Checks for the '[debug]' string in the commit message to compile as debug instead of release.
build_type: ${{ contains(github.event.head_commit.message, '[debug]') && 'Debug' || 'Release' }}
# Checks whether the event corresponds to a tag to activate the automatic creation of a release.
is_tagged: ${{ startsWith(github.ref, 'refs/tags/') }}
jobs:
# Checks source code formatting with clang before compiling.
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '18'
check-path: '.'
# Creates a cache for the model downloaded and transcribed
# into the C++ file for embedding in the binary.
Cache:
runs-on: ubuntu-latest
needs: Format
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache
uses: actions/cache@v4
with:
path: ./build/source
key: wvp-model-tiny
enableCrossOsArchive: true
- name: Configure
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.build_type }}
# Compiles, tests and packages the plugin for Ubuntu.
Ubuntu:
runs-on: ubuntu-latest
needs: Cache
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache
uses: actions/cache@v4
with:
path: ./build/source
key: wvp-model-tiny
enableCrossOsArchive: true
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Configure
run: cmake -B ${{ github.workspace }}/build -G Ninja -DCMAKE_BUILD_TYPE=${{ env.build_type }}
- name: Build
run: cmake --build ${{ github.workspace }}/build
- name: Test
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build
- name: Artifact
uses: actions/upload-artifact@v4.3.6
with:
name: Whisper-Linux
path: ${{ github.workspace }}/package/Whisper.tar.gz
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ env.is_tagged }} != 'true'
with:
draft: true
prerelease: true
fail_on_unmatched_files: true
files: ${{ github.workspace }}/package/Whisper.tar.gz
# Compiles, tests and packages the plugin for Windows.
Windows:
runs-on: windows-latest
needs: Cache
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache
uses: actions/cache@v4
with:
path: ./build/source
key: wvp-model-tiny
enableCrossOsArchive: true
- name: Configure
run: cmake -B ${{ github.workspace }}/build -G "Visual Studio 17 2022" -A x64
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }}
- name: Test
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build
- name: Artifact
uses: actions/upload-artifact@v4.3.6
with:
name: Whisper-Windows
path: ${{ github.workspace }}/package/Whisper-install.exe
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ env.is_tagged }} != 'true'
with:
draft: true
prerelease: true
fail_on_unmatched_files: true
files: ${{ github.workspace }}/package/Whisper-install.exe
# Compiles, tests and packages the plugin for MacOS.
MacOS:
runs-on: macos-latest
needs: Cache
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache
uses: actions/cache@v4
with:
path: ./build/source
key: wvp-model-tiny
enableCrossOsArchive: true
- name: Prepare
run: |
security create-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent
security unlock-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent
security list-keychains -s buildagent && security default-keychain -s buildagent
echo ${{ secrets.DEV_ID_APP_CERT }} | base64 --decode > ./cert.p12
security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null
rm ./cert.p12
echo ${{ secrets.DEV_ID_INST_CERT }} | base64 --decode > ./cert.p12
security import ./cert.p12 -P ${{ secrets.DEV_ID_PASSWORD }} -A -t cert -f pkcs12 -k buildagent -T /usr/bin/codesign >/dev/null
rm ./cert.p12
security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k ${{ secrets.DEV_ID_PASSWORD }} buildagent >/dev/null
xcrun notarytool store-credentials "notary-installer" --apple-id ${{ secrets.DEV_USER_APPLE_ID }} --team-id ${{ secrets.DEV_TEAM_APPLE_ID }} --password ${{ secrets.DEV_SPEC_APP_PASSWORD }} >/dev/null
- name: Configure
run: cmake -B ${{ github.workspace }}/build -G "Xcode" -DVPP_CODESIGN_APPLE_KEYCHAIN_PROFILE_INSTALLER="notary-installer" -DVPP_NOTARIZE=ON
- name: Build
run: |
security unlock-keychain -p ${{ secrets.DEV_ID_PASSWORD }} buildagent
security set-keychain-settings -lut 7200 buildagent
set -o pipefail && cmake --build ${{ github.workspace }}/build --config ${{ env.build_type }} | xcbeautify --renderer github-actions
- name: Test
run: ctest -C ${{ env.build_type }} -VV --test-dir ${{ github.workspace }}/build
- name: Artifact
uses: actions/upload-artifact@v4.3.6
with:
name: Whisper-MacOS
path: ${{ github.workspace }}/package/Whisper.pkg
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ env.is_tagged }} != 'true'
with:
draft: true
prerelease: true
fail_on_unmatched_files: true
files: ${{ github.workspace }}/package/Whisper.pkg