Skip to content

Commit 119ee20

Browse files
authored
ci: don't enable sccache on tag refs (#2429)
This prevents GitHub Actions cache usage on tag refs, which should pre-empt any potential cache poisoning of release workflows (i.e. those done on tag pushes). Closes #2425. Signed-off-by: William Woodruff <[email protected]>
1 parent 886acd9 commit 119ee20

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/ci.rs

+30-30
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ jobs:\n",
373373
with:
374374
target: ${{{{ matrix.platform.target }}}}
375375
args: --release --out dist{maturin_args}
376-
sccache: 'true'
376+
sccache: ${{{{ !startsWith(github.ref, 'refs/tags/') }}}}
377377
"
378378
));
379379
let maturin_action_args = match platform {
@@ -393,7 +393,7 @@ jobs:\n",
393393
with:
394394
target: ${{{{ matrix.platform.target }}}}
395395
args: --release --out dist{maturin_args} -i python3.13t
396-
sccache: 'true'
396+
sccache: ${{{{ !startsWith(github.ref, 'refs/tags/') }}}}
397397
"
398398
));
399399
if !maturin_action_args.is_empty() {
@@ -729,7 +729,7 @@ mod tests {
729729
with:
730730
target: ${{ matrix.platform.target }}
731731
args: --release --out dist --find-interpreter
732-
sccache: 'true'
732+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
733733
manylinux: auto
734734
- name: Upload wheels
735735
uses: actions/upload-artifact@v4
@@ -760,7 +760,7 @@ mod tests {
760760
with:
761761
target: ${{ matrix.platform.target }}
762762
args: --release --out dist --find-interpreter
763-
sccache: 'true'
763+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
764764
manylinux: musllinux_1_2
765765
- name: Upload wheels
766766
uses: actions/upload-artifact@v4
@@ -788,7 +788,7 @@ mod tests {
788788
with:
789789
target: ${{ matrix.platform.target }}
790790
args: --release --out dist --find-interpreter
791-
sccache: 'true'
791+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
792792
- name: Upload wheels
793793
uses: actions/upload-artifact@v4
794794
with:
@@ -814,7 +814,7 @@ mod tests {
814814
with:
815815
target: ${{ matrix.platform.target }}
816816
args: --release --out dist --find-interpreter
817-
sccache: 'true'
817+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
818818
- name: Upload wheels
819819
uses: actions/upload-artifact@v4
820820
with:
@@ -929,14 +929,14 @@ mod tests {
929929
with:
930930
target: ${{ matrix.platform.target }}
931931
args: --release --out dist
932-
sccache: 'true'
932+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
933933
manylinux: auto
934934
- name: Build free-threaded wheels
935935
uses: PyO3/maturin-action@v1
936936
with:
937937
target: ${{ matrix.platform.target }}
938938
args: --release --out dist -i python3.13t
939-
sccache: 'true'
939+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
940940
manylinux: auto
941941
- name: Upload wheels
942942
uses: actions/upload-artifact@v4
@@ -967,14 +967,14 @@ mod tests {
967967
with:
968968
target: ${{ matrix.platform.target }}
969969
args: --release --out dist
970-
sccache: 'true'
970+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
971971
manylinux: musllinux_1_2
972972
- name: Build free-threaded wheels
973973
uses: PyO3/maturin-action@v1
974974
with:
975975
target: ${{ matrix.platform.target }}
976976
args: --release --out dist -i python3.13t
977-
sccache: 'true'
977+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
978978
manylinux: musllinux_1_2
979979
- name: Upload wheels
980980
uses: actions/upload-artifact@v4
@@ -1002,13 +1002,13 @@ mod tests {
10021002
with:
10031003
target: ${{ matrix.platform.target }}
10041004
args: --release --out dist
1005-
sccache: 'true'
1005+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
10061006
- name: Build free-threaded wheels
10071007
uses: PyO3/maturin-action@v1
10081008
with:
10091009
target: ${{ matrix.platform.target }}
10101010
args: --release --out dist -i python3.13t
1011-
sccache: 'true'
1011+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
10121012
- name: Upload wheels
10131013
uses: actions/upload-artifact@v4
10141014
with:
@@ -1034,13 +1034,13 @@ mod tests {
10341034
with:
10351035
target: ${{ matrix.platform.target }}
10361036
args: --release --out dist
1037-
sccache: 'true'
1037+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
10381038
- name: Build free-threaded wheels
10391039
uses: PyO3/maturin-action@v1
10401040
with:
10411041
target: ${{ matrix.platform.target }}
10421042
args: --release --out dist -i python3.13t
1043-
sccache: 'true'
1043+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
10441044
- name: Upload wheels
10451045
uses: actions/upload-artifact@v4
10461046
with:
@@ -1143,14 +1143,14 @@ mod tests {
11431143
with:
11441144
target: ${{ matrix.platform.target }}
11451145
args: --release --out dist
1146-
sccache: 'true'
1146+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
11471147
manylinux: auto
11481148
- name: Build free-threaded wheels
11491149
uses: PyO3/maturin-action@v1
11501150
with:
11511151
target: ${{ matrix.platform.target }}
11521152
args: --release --out dist -i python3.13t
1153-
sccache: 'true'
1153+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
11541154
manylinux: auto
11551155
- name: Upload wheels
11561156
uses: actions/upload-artifact@v4
@@ -1181,14 +1181,14 @@ mod tests {
11811181
with:
11821182
target: ${{ matrix.platform.target }}
11831183
args: --release --out dist
1184-
sccache: 'true'
1184+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
11851185
manylinux: musllinux_1_2
11861186
- name: Build free-threaded wheels
11871187
uses: PyO3/maturin-action@v1
11881188
with:
11891189
target: ${{ matrix.platform.target }}
11901190
args: --release --out dist -i python3.13t
1191-
sccache: 'true'
1191+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
11921192
manylinux: musllinux_1_2
11931193
- name: Upload wheels
11941194
uses: actions/upload-artifact@v4
@@ -1216,13 +1216,13 @@ mod tests {
12161216
with:
12171217
target: ${{ matrix.platform.target }}
12181218
args: --release --out dist
1219-
sccache: 'true'
1219+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
12201220
- name: Build free-threaded wheels
12211221
uses: PyO3/maturin-action@v1
12221222
with:
12231223
target: ${{ matrix.platform.target }}
12241224
args: --release --out dist -i python3.13t
1225-
sccache: 'true'
1225+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
12261226
- name: Upload wheels
12271227
uses: actions/upload-artifact@v4
12281228
with:
@@ -1248,13 +1248,13 @@ mod tests {
12481248
with:
12491249
target: ${{ matrix.platform.target }}
12501250
args: --release --out dist
1251-
sccache: 'true'
1251+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
12521252
- name: Build free-threaded wheels
12531253
uses: PyO3/maturin-action@v1
12541254
with:
12551255
target: ${{ matrix.platform.target }}
12561256
args: --release --out dist -i python3.13t
1257-
sccache: 'true'
1257+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
12581258
- name: Upload wheels
12591259
uses: actions/upload-artifact@v4
12601260
with:
@@ -1349,7 +1349,7 @@ mod tests {
13491349
with:
13501350
target: ${{ matrix.platform.target }}
13511351
args: --release --out dist --find-interpreter --zig
1352-
sccache: 'true'
1352+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
13531353
manylinux: auto
13541354
- name: Upload wheels
13551355
uses: actions/upload-artifact@v4
@@ -1405,7 +1405,7 @@ mod tests {
14051405
with:
14061406
target: ${{ matrix.platform.target }}
14071407
args: --release --out dist --find-interpreter
1408-
sccache: 'true'
1408+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
14091409
manylinux: musllinux_1_2
14101410
- name: Upload wheels
14111411
uses: actions/upload-artifact@v4
@@ -1463,7 +1463,7 @@ mod tests {
14631463
with:
14641464
target: ${{ matrix.platform.target }}
14651465
args: --release --out dist --find-interpreter
1466-
sccache: 'true'
1466+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
14671467
- name: Upload wheels
14681468
uses: actions/upload-artifact@v4
14691469
with:
@@ -1499,7 +1499,7 @@ mod tests {
14991499
with:
15001500
target: ${{ matrix.platform.target }}
15011501
args: --release --out dist --find-interpreter
1502-
sccache: 'true'
1502+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
15031503
- name: Upload wheels
15041504
uses: actions/upload-artifact@v4
15051505
with:
@@ -1608,7 +1608,7 @@ mod tests {
16081608
with:
16091609
target: ${{ matrix.platform.target }}
16101610
args: --release --out dist
1611-
sccache: 'true'
1611+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
16121612
manylinux: auto
16131613
- name: Upload wheels
16141614
uses: actions/upload-artifact@v4
@@ -1636,7 +1636,7 @@ mod tests {
16361636
with:
16371637
target: ${{ matrix.platform.target }}
16381638
args: --release --out dist
1639-
sccache: 'true'
1639+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
16401640
manylinux: musllinux_1_2
16411641
- name: Upload wheels
16421642
uses: actions/upload-artifact@v4
@@ -1660,7 +1660,7 @@ mod tests {
16601660
with:
16611661
target: ${{ matrix.platform.target }}
16621662
args: --release --out dist
1663-
sccache: 'true'
1663+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
16641664
- name: Upload wheels
16651665
uses: actions/upload-artifact@v4
16661666
with:
@@ -1683,7 +1683,7 @@ mod tests {
16831683
with:
16841684
target: ${{ matrix.platform.target }}
16851685
args: --release --out dist
1686-
sccache: 'true'
1686+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
16871687
- name: Upload wheels
16881688
uses: actions/upload-artifact@v4
16891689
with:

0 commit comments

Comments
 (0)