@@ -125,16 +125,16 @@ runs:
125
125
fi
126
126
echo "SHA256SUM=$SHA256SUM" >> $GITHUB_ENV
127
127
128
- - name : Cache Tailscale Binary - Linux
128
+ - name : Restore Tailscale Binary - Linux
129
129
if : ${{ inputs.use-cache == 'true' && runner.os == 'Linux' }}
130
- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
131
- id : cache-tailscale-linux
130
+ uses : actions/cache/restore @5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
131
+ id : restore- cache-tailscale-linux
132
132
with :
133
133
path : tailscale.tgz
134
134
key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ env.TS_ARCH }}-${{ env.SHA256SUM }}
135
135
136
136
- name : Download Tailscale - Linux
137
- if : ${{ runner.os == 'Linux' && (inputs.use-cache != 'true' || steps.cache-tailscale-linux.outputs.cache-hit != 'true') }}
137
+ if : ${{ runner.os == 'Linux' && (inputs.use-cache != 'true' || steps.restore- cache-tailscale-linux.outputs.cache-hit != 'true') }}
138
138
shell : bash
139
139
run : |
140
140
MINOR=$(echo "$RESOLVED_VERSION" | awk -F '.' {'print $2'})
@@ -148,12 +148,21 @@ runs:
148
148
echo "Expected sha256: $SHA256SUM"
149
149
echo "Actual sha256: $(sha256sum tailscale.tgz)"
150
150
echo "$SHA256SUM tailscale.tgz" | sha256sum -c
151
+
152
+ - name : Save Tailscale Binary - Linux
153
+ if : ${{ inputs.use-cache == 'true' && steps.restore-cache-tailscale-linux.outputs.cache-hit != 'true' && runner.os == 'Linux' }}
154
+ uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
155
+ id : save-cache-tailscale-linux
156
+ with :
157
+ path : tailscale.tgz
158
+ key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ env.TS_ARCH }}-${{ env.SHA256SUM }}
151
159
152
160
- name : Install Tailscale - Linux
153
161
if : ${{ runner.os == 'Linux' }}
154
162
shell : bash
155
163
run : |
156
164
tar -C /tmp -xzf tailscale.tgz
165
+ rm tailscale.tgz
157
166
TSPATH=/tmp/tailscale_${RESOLVED_VERSION}_${TS_ARCH}
158
167
sudo mv "${TSPATH}/tailscale" "${TSPATH}/tailscaled" /usr/bin
159
168
@@ -175,16 +184,16 @@ runs:
175
184
fi
176
185
echo "SHA256SUM=$SHA256SUM" >> $GITHUB_ENV
177
186
178
- - name : Cache Tailscale Binary - Windows
187
+ - name : Restore Tailscale Binary - Windows
179
188
if : ${{ inputs.use-cache == 'true' && runner.os == 'Windows' }}
180
- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
181
- id : cache-tailscale-windows
189
+ uses : actions/cache/restore @5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
190
+ id : restore- cache-tailscale-windows
182
191
with :
183
192
path : tailscale.msi
184
193
key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ env.TS_ARCH }}-${{ env.SHA256SUM }}
185
194
186
195
- name : Download Tailscale - Windows
187
- if : ${{ runner.os == 'Windows' && (inputs.use-cache != 'true' || steps.cache-tailscale-windows.outputs.cache-hit != 'true') }}
196
+ if : ${{ runner.os == 'Windows' && (inputs.use-cache != 'true' || steps.restore- cache-tailscale-windows.outputs.cache-hit != 'true') }}
188
197
shell : bash
189
198
run : |
190
199
MINOR=$(echo "$RESOLVED_VERSION" | awk -F '.' {'print $2'})
@@ -198,12 +207,22 @@ runs:
198
207
echo "Expected sha256: $SHA256SUM"
199
208
echo "Actual sha256: $(sha256sum tailscale.msi)"
200
209
echo "$SHA256SUM tailscale.msi" | sha256sum -c
210
+
211
+ - name : Save Tailscale Binary - Windows
212
+ if : ${{ inputs.use-cache == 'true' && steps.restore-cache-tailscale-windows.outputs.cache-hit != 'true' && runner.os == 'Windows' }}
213
+ uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
214
+ id : save-cache-tailscale-windows
215
+ with :
216
+ path : tailscale.msi
217
+ key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ env.TS_ARCH }}-${{ env.SHA256SUM }}
218
+
201
219
- name : Install Tailscale - Windows
202
220
if : ${{ runner.os == 'Windows' }}
203
221
shell : pwsh
204
222
run : |
205
- Start-Process "C:\Windows\System32\msiexec.exe" -Wait -ArgumentList @('/quiet', '/l*v tailscale.log', '/i', 'tailscale.msi')
223
+ Start-Process "C:\Windows\System32\msiexec.exe" -Wait -ArgumentList @('/quiet', '/l*v ${{ runner.temp }}/ tailscale.log', '/i', 'tailscale.msi')
206
224
Add-Content $env:GITHUB_PATH "C:\Program Files\Tailscale\"
225
+ Remove-Item tailscale.msi -Force;
207
226
- name : Checkout Tailscale repo - macOS
208
227
id : checkout-tailscale-macos
209
228
if : ${{ runner.os == 'macOS' }}
@@ -212,24 +231,38 @@ runs:
212
231
repository : tailscale/tailscale
213
232
path : ${{ github.workspace }}/tailscale
214
233
ref : v${{ env.RESOLVED_VERSION }}
215
- - name : Cache Tailscale - macOS
234
+ - name : Restore Tailscale - macOS
216
235
if : ${{ inputs.use-cache == 'true' && runner.os == 'macOS' }}
217
- id : cache-tailscale-macos
218
- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
236
+ id : restore- cache-tailscale-macos
237
+ uses : actions/cache/restore @5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
219
238
with :
220
239
path : |
221
240
/usr/local/bin/tailscale
222
241
/usr/local/bin/tailscaled
223
242
key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ runner.arch }}-${{ steps.checkout-tailscale-macos.outputs.commit }}
224
243
- name : Build Tailscale binaries - macOS
225
- if : ${{ runner.os == 'macOS' && (inputs.use-cache != 'true' || steps.cache-tailscale-macos.outputs.cache-hit != 'true') }}
244
+ if : ${{ runner.os == 'macOS' && (inputs.use-cache != 'true' || steps.restore- cache-tailscale-macos.outputs.cache-hit != 'true') }}
226
245
shell : bash
227
246
run : |
228
247
cd tailscale
229
248
export TS_USE_TOOLCHAIN=1
230
249
./build_dist.sh ./cmd/tailscale
231
250
./build_dist.sh ./cmd/tailscaled
232
251
sudo mv tailscale tailscaled /usr/local/bin
252
+ - name : Remove tailscale checkout - macOS
253
+ if : ${{ runner.os == 'macOS' }}
254
+ shell : bash
255
+ run : |
256
+ rm -Rf ${{ github.workspace }}/tailscale
257
+ - name : Save Tailscale - macOS
258
+ if : ${{ inputs.use-cache == 'true' && runner.os == 'macOS' }}
259
+ id : save-cache-tailscale-macos
260
+ uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
261
+ with :
262
+ path : |
263
+ /usr/local/bin/tailscale
264
+ /usr/local/bin/tailscaled
265
+ key : ${{ runner.os }}-tailscale-${{ env.RESOLVED_VERSION }}-${{ runner.arch }}-${{ steps.checkout-tailscale-macos.outputs.commit }}
233
266
- name : Install timeout - macOS
234
267
if : ${{ runner.os == 'macOS' }}
235
268
shell : bash
0 commit comments