-
Notifications
You must be signed in to change notification settings - Fork 76
124 lines (124 loc) · 5.38 KB
/
continuous-integration.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
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- msvc_config: x64-Release
msvc_arch: amd64
build_type: RelWithDebInfo
- msvc_config: x86-Release
msvc_arch: amd64_x86
build_type: RelWithDebInfo
- msvc_config: x64-Debug
msvc_arch: amd64
build_type: Debug
- msvc_config: x86-Debug
msvc_arch: amd64_x86
build_type: Debug
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Required for version stamping (`git describe`) to work.
fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_arch }}
- run: cmake -S src -B src/out/build/${{ matrix.msvc_config }} -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}/src/out/install/${{ matrix.msvc_config }}
- run: cmake --build src/out/build/${{ matrix.msvc_config }}
- run: cmake --install src/out/build/${{ matrix.msvc_config }}
- uses: actions/upload-artifact@v4
with:
name: FlexASIO-${{ matrix.msvc_config }}
path: src/out/install/${{ matrix.msvc_config }}/
# hhttps://github.com/actions/runner-images/issues/2528#issuecomment-2132193207
# TODO: Scream only provides an output device. See if we can use a
# different virtual audio driver that provides a virtual input device as
# well.
- run: 'Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip'
- run: 'Expand-Archive -Path Scream4.0.zip -DestinationPath Scream'
# To work around https://github.com/duncanthrax/scream/issues/215, create our own self-signed certificate for the Scream driver.
# makecert.exe insists on interactively asking the user for a password (sigh...), so use OpenSSL instead.
# `-extensions v3_req` is a trick to make sure the resulting cert has basic constraint CA:FALSE (the default is CA:TRUE which is problematic here) without having to create an OpenSSL config file.
- run: 'openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req'
- run: 'openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:'
# Sign the driver with the self-signed certificate we just made.
- run: 'signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat'
# Tell Windows to trust the self-signed certificate we just made.
# (For some reason it has to be added to both stores for it to work.)
- run: 'Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root'
- run: 'Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher'
# Finally, install the driver.
- run: 'Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream'
# For convenience, make sure we fail fast if for whatever reason the install gets blocked on some GUI prompt.
timeout-minutes: 5
# Starting from windows-2022, the Windows Audio engine doesn't seem to
# be started by default anymore.
- run: net start audiosrv
# Obviously this doesn't do any kind of thorough testing. We just want to
# make sure that the executables are not obviously broken.
- run: src/out/install/${{ matrix.msvc_config }}/bin/PortAudioDevices.exe
- run: src/out/install/${{ matrix.msvc_config }}/bin/FlexASIOTest.exe --verbose
installer:
runs-on: windows-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Required for version stamping (`git describe`) to work.
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: FlexASIO-x64-Release
path: src/out/install/x64-Release
- uses: actions/download-artifact@v4
with:
name: FlexASIO-x86-Release
path: src/out/install/x86-Release
- run: cmake -P installer.cmake
working-directory: src
- uses: actions/upload-artifact@v4
with:
name: FlexASIO-installer
path: src/out/installer/*
sigstore:
runs-on: ubuntu-latest
needs: installer
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: FlexASIO-installer
- uses: sigstore/[email protected]
with:
inputs: "*"
- uses: actions/upload-artifact@v3
with:
name: sigstore
path: "*.sigstore"
if-no-files-found: error
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/flexasio-')
needs:
- installer
- sigstore
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
with:
name: FlexASIO-installer
- uses: actions/download-artifact@v3
with:
name: sigstore
- uses: softprops/action-gh-release@v1
with:
draft: true
files: "*"
generate_release_notes: true