Skip to content

Commit 2c744e8

Browse files
committed
[skip ci] move skip check into its own job to prevent errors on windows
1 parent fc14d26 commit 2c744e8

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

.github/workflows/gradle.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ on:
1010
- '[3-9]+.[3-9]+.x'
1111
workflow_dispatch:
1212
jobs:
13-
build:
13+
skip_check:
14+
runs-on: ubuntu-latest
1415
outputs:
1516
found_skip_publish: ${{ steps.check_prevent_property.outputs.value }}
1617
permissions:
17-
contents: read # to fetch code (actions/checkout)
18-
strategy:
19-
matrix:
20-
java: [17, 21, 23]
21-
os: [ubuntu-latest, windows-latest, macos-latest]
22-
runs-on: ${{ matrix.os }}
18+
contents: read
2319
steps:
2420
- name: "📥 Checkout repository"
2521
uses: actions/checkout@v4
@@ -31,6 +27,18 @@ jobs:
3127
else
3228
echo "value=false" >> $GITHUB_OUTPUT
3329
fi
30+
build:
31+
needs: skip_check
32+
permissions:
33+
contents: read # to fetch code (actions/checkout)
34+
strategy:
35+
matrix:
36+
java: [17, 21, 23]
37+
os: [ubuntu-latest, windows-latest, macos-latest]
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- name: "📥 Checkout repository"
41+
uses: actions/checkout@v4
3442
- name: "☕️ Setup JDK"
3543
uses: actions/setup-java@v4
3644
with:
@@ -47,7 +55,7 @@ jobs:
4755
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
4856
run: ./gradlew build assemble groovydoc
4957
publish:
50-
if: github.event_name == 'push' && needs.build.outputs.found_skip_publish != 'true'
58+
if: github.event_name == 'push' && needs.skip_check.outputs.found_skip_publish != 'true'
5159
needs: build
5260
permissions:
5361
contents: read # limit to read access
@@ -76,7 +84,7 @@ jobs:
7684
-Dorg.gradle.internal.publish.checksums.insecure=true
7785
publish
7886
docs:
79-
if: github.event_name == 'push' && needs.build.outputs.found_skip_publish != 'true'
87+
if: github.event_name == 'push' && needs.skip_check.outputs.found_skip_publish != 'true'
8088
needs: publish
8189
runs-on: ubuntu-latest
8290
permissions:

0 commit comments

Comments
 (0)