File tree Expand file tree Collapse file tree 5 files changed +44
-29
lines changed Expand file tree Collapse file tree 5 files changed +44
-29
lines changed Original file line number Diff line number Diff line change @@ -2,27 +2,27 @@ name: Gradle Build
22
33on :
44 push :
5- branches : [ "main" ]
6- paths :
7- - " src/**"
8- - " build.gradle.kts"
9- - " settings.gradle.kts"
10- - " gradle.properties"
11- - " gradle/**"
12- - " buildSrc/**"
13- - " gradlew"
14- - " gradlew.bat"
15- - " .github/workflows/gradle-build.yml"
5+ branches :
6+ - " main"
7+ - " dev"
8+ - " dev/*"
9+ - " feature/*"
10+ - " bugfix/*"
11+ - " release/*"
1612 pull_request :
17- branches : [ "main" ]
13+ branches :
14+ - " main"
15+ - " release/*"
1816
1917jobs :
2018 build :
19+ name : Build
2120 runs-on : ubuntu-latest
2221 permissions :
2322 contents : read
2423 steps :
25- - uses : actions/checkout@v5
24+ - name : Checkout
25+ uses : actions/checkout@v5
2626
2727 - name : Set up JDK 17
2828 uses : actions/setup-java@v5
3535 - name : Setup Gradle
3636 uses : gradle/actions/setup-gradle@v4
3737
38- - name : Build with Gradle Wrapper
38+ - name : Build
3939 run : ./gradlew build
Original file line number Diff line number Diff line change 11name : Dependency Submission
22
3+ # workflow limited to only files related to gradle dependencies
34on :
45 push :
5- branches : [ "main" ]
6+ branches :
7+ - " main"
8+ - " release/*"
69 paths :
710 - " build.gradle.kts"
811 - " settings.gradle.kts"
12+ - " gradle.properties"
913 - " gradle/**"
1014 - " buildSrc/**"
15+ - " gradlew"
16+ - " gradlew.bat"
1117 - " .github/workflows/gradle-dependency-submission.yml"
1218
1319jobs :
1420 dependency-submission :
21+ name : Dependency Submission
1522 runs-on : ubuntu-latest
1623 permissions :
1724 contents : write
1825 steps :
19- - uses : actions/checkout@v5
26+ - name : Checkout
27+ uses : actions/checkout@v5
2028
2129 - name : Set up JDK 17
2230 uses : actions/setup-java@v5
Original file line number Diff line number Diff line change 77 - " v[0-9]*.[0-9]*.[0-9]*-*" # pattern for v1.2.3-suffix
88
99jobs :
10- publish :
10+ publish-release :
11+ name : Publish Release
1112 runs-on : ubuntu-latest
1213 permissions :
1314 contents : read
1415 steps :
15- - uses : actions/checkout@v5
16+ - name : Checkout
17+ uses : actions/checkout@v5
1618
1719 - name : Set up JDK 17
1820 uses : actions/setup-java@v5
2527 - name : Setup Gradle
2628 uses : gradle/actions/setup-gradle@v4
2729
28- - name : Publish with Gradle Wrapper
30+ - name : Publish Release
2931 env :
3032 SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
3133 SIGNING_PASSWORD : ${{ secrets.SIGNING_PASSWORD }}
Original file line number Diff line number Diff line change 44 workflow_dispatch :
55 schedule :
66 - cron : " 0 15 * * 5" # friday 15:00 UTC
7+
78jobs :
89 check-branch :
10+ name : Check Branch
911 runs-on : ubuntu-latest
1012 steps :
1113 - name : Check Branch
12- if : github.ref != 'refs/heads/main'
14+ if : startsWith( github.ref, 'refs/heads/')
1315 run : |
14- echo "::error title=wrong branch selected::this workflow must be run on the 'main' branch"
15- exit 1
16+ BRANCH="${GITHUB_REF#refs/heads/}"
17+ if [[ "$BRANCH" != "main" && "$BRANCH" != "dev" && "$BRANCH" != dev/* && "$BRANCH" != release/* ]]; then
18+ echo "::error title=wrong branch selected::this workflow must be run on 'main', 'dev/*' or 'release/*' branches"
19+ exit 1
20+ fi
1621
1722 check-updates :
23+ name : Check Updates
1824 runs-on : ubuntu-latest
1925 outputs :
2026 should_run : ${{ steps.check.outputs.should_run }}
2127 steps :
2228 - name : Checkout
2329 uses : actions/checkout@v5
24- with :
25- ref : main
26- fetch-depth : 50
2730
2831 - name : Check if SNAPSHOT publish is applicable
2932 id : check
@@ -42,14 +45,13 @@ jobs:
4245 fi
4346
4447 publish-snapshot :
48+ name : Publish problem4j-core SNAPSHOT
4549 needs : [check-branch, check-updates]
4650 if : needs.check-updates.outputs.should_run == 'true'
4751 runs-on : ubuntu-latest
4852 steps :
4953 - name : Checkout
5054 uses : actions/checkout@v5
51- with :
52- ref : main
5355
5456 - name : Set up JDK 17
5557 uses : actions/setup-java@v5
8082 echo "::notice::evaluated snapshot version: $SNAPSHOT_VERSION"
8183 echo "version=$SNAPSHOT_VERSION" >> $GITHUB_OUTPUT
8284
83- - name : Publish Snapshot with Gradle Wrapper
85+ - name : Publish Snapshot
8486 env :
8587 SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
8688 SIGNING_PASSWORD : ${{ secrets.SIGNING_PASSWORD }}
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ name: Validate [next_version.txt]
22
33on :
44 push :
5- branches : [ "main" ]
5+ branches :
6+ - " main"
7+ - " release/*"
68 paths :
79 - " .github/utils/next_version.txt"
810 - " .github/utils/validate_version_file.sh"
1517
1618jobs :
1719 validate :
20+ name : Validate SNAPSHOT version files
1821 runs-on : ubuntu-latest
1922 steps :
2023 - name : Checkout
You can’t perform that action at this time.
0 commit comments