Skip to content

Commit 312597a

Browse files
committed
Rework Windows CI build
1 parent 8bd00d2 commit 312597a

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

.github/workflows/build-workspace.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,36 @@ jobs:
6161
path: ntsc-rs-linux-standalone
6262

6363
build-windows:
64-
runs-on: windows-2019
64+
runs-on: windows-2022
6565

6666
steps:
67-
# This is an attempt to make the Windows CI image faster. Not sure if it works.
68-
- name: Disable Defender
69-
run: Set-MpPreference -DisableRealtimeMonitoring $true
70-
7167
- name: Checkout
7268
uses: actions/checkout@v4
7369
with:
7470
submodules: recursive
7571

72+
- name: Set up workspace path
73+
run: echo "FAST_WORKSPACE=D:\workspace" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
74+
75+
- name: Copy Git repo to D drive
76+
run: |
77+
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.FAST_WORKSPACE }}" -Recurse
78+
7679
# Put the Chocolatey temp directory in a place where we can use the cache action to save and restore it.
77-
- name: Set chocolatey temp directory
80+
- name: Set Chocolatey temp directory
7881
run: |
79-
choco config set cacheLocation --value "$Env:GITHUB_WORKSPACE\chocolatey_cache"
80-
echo "CHOCO_TEMP=$Env:GITHUB_WORKSPACE\chocolatey_cache" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
82+
choco config set cacheLocation --value "D:\chocolatey_cache"
83+
echo "CHOCO_TEMP=D:\chocolatey_cache" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
84+
85+
- name: Get current GStreamer package version
86+
run: echo "GST_PACKAGE_VERSION=$(choco info -y --limit-output gstreamer)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
8187

8288
- name: Restore Chocolatey cache
8389
id: choco-cache-restore
8490
uses: actions/cache/restore@v4
8591
with:
8692
path: ${{ env.CHOCO_TEMP }}
87-
# TODO: Why did I set up the cache key like this?
88-
key: 'this should never hit'
89-
restore-keys: choco-${{ github.job }}-
93+
key: choco-${{ github.job }}-${{ env.GST_PACKAGE_VERSION }}
9094

9195
- name: Install gstreamer
9296
# Some things to note:
@@ -95,7 +99,7 @@ jobs:
9599
# seemingly chosen at random.
96100
# - We need to export said path to the environment variables so that later steps can use it.
97101
run: |
98-
choco install gstreamer gstreamer-devel
102+
choco install -y gstreamer gstreamer-devel
99103
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
100104
refreshenv
101105
echo "$($Env:GSTREAMER_1_0_ROOT_MSVC_X86_64)bin"
@@ -107,28 +111,36 @@ jobs:
107111
uses: actions/cache/save@v4
108112
with:
109113
path: ${{ env.CHOCO_TEMP }}
110-
# TODO: Pretty sure I'm misunderstanding the point of hashFiles here.
111-
key: choco-${{ github.job }}-${{ hashFiles(format('{0}\**\*', env.CHOCO_TEMP)) }}
114+
key: choco-${{ github.job }}-${{ env.GST_PACKAGE_VERSION }}
112115

113116
- uses: Swatinem/rust-cache@v2
117+
with:
118+
workspaces: ${{ env.FAST_WORKSPACE }}
114119

115120
- name: Build GUI
116121
run: cargo build --release -p gui
122+
working-directory: ${{ env.FAST_WORKSPACE }}
117123

118124
- name: Build OpenFX plugin
119125
run: cargo xtask build-ofx-plugin --release
126+
working-directory: ${{ env.FAST_WORKSPACE }}
120127

121128
- name: Build After Effects plugin
122129
run: |
123130
cargo build --release -p ae-plugin
124131
cp target\release\ae_plugin.dll .\ntsc-rs-ae.aex
132+
working-directory: ${{ env.FAST_WORKSPACE }}
133+
134+
- name: Package OpenFX plugin
135+
run: cargo xtask build-ofx-plugin --release
136+
working-directory: ${{ env.FAST_WORKSPACE }}
125137

126138
- name: Archive Windows OpenFX plugin
127139
uses: actions/upload-artifact@v4
128140
if: ${{ github.ref_type == 'tag' }}
129141
with:
130142
name: ntsc-rs-windows-openfx
131-
path: crates/openfx-plugin/build/
143+
path: ${{ env.FAST_WORKSPACE }}/crates/openfx-plugin/build/
132144

133145
- name: Package Windows binary
134146
if: ${{ github.ref_type == 'tag' }}
@@ -143,20 +155,21 @@ jobs:
143155
cp ..\target\release\ntsc-rs-standalone.exe .\bin\
144156
cp ..\target\release\ntsc-rs-cli.exe .\bin\
145157
cp ..\target\release\ntsc-rs-launcher.exe .\
158+
working-directory: ${{ env.FAST_WORKSPACE }}
146159

147160
- name: Archive Windows binary
148161
uses: actions/upload-artifact@v4
149162
if: ${{ github.ref_type == 'tag' }}
150163
with:
151164
name: ntsc-rs-windows-standalone
152-
path: ntsc-rs-windows-standalone
165+
path: ${{ env.FAST_WORKSPACE }}/ntsc-rs-windows-standalone
153166

154167
- name: Archive Windows After Effects plugin
155168
uses: actions/upload-artifact@v4
156169
if: ${{ github.ref_type == 'tag' }}
157170
with:
158171
name: ntsc-rs-windows-afterfx
159-
path: .\ntsc-rs-ae.aex
172+
path: ${{ env.FAST_WORKSPACE }}/ntsc-rs-ae.aex
160173

161174
build-macos:
162175
runs-on: macos-14

0 commit comments

Comments
 (0)