Skip to content

Commit af7677c

Browse files
committed
update github actions script to v4
also fetch entire git history so that mcGitVersion can work its magic
1 parent a9fca3f commit af7677c

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/build_and_publish.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v1
12-
- uses: actions/cache@v2
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: '0'
14+
submodules: 'recursive'
15+
- uses: actions/cache@v4
1316
with:
1417
path: |
1518
~/.gradle/caches
1619
~/.gradle/wrapper
1720
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
1821
restore-keys: |
1922
${{ runner.os }}-gradle-
20-
- name: Set up git submodules
21-
run: git submodule init && git submodule update
2223
- name: Set up JDK 1.8
23-
uses: actions/setup-java@v1
24+
uses: actions/setup-java@v4
2425
with:
25-
java-version: 1.8
26+
distribution: 'temurin'
27+
java-version: '8'
2628
- name: Build with Gradle
2729
env:
2830
sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
2931
sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
3032
run: ./gradlew build publish
31-
- uses: actions/upload-artifact@v2
33+
- uses: actions/upload-artifact@v4
3234
with:
3335
name: Compiled jars
3436
path: build/libs/*

Jenkinsfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ pipeline {
5555
}
5656
}
5757
stage("Publish") {
58+
when {
59+
anyOf {
60+
branch "MC_1.12"
61+
}
62+
}
5863
steps {
5964
sh "./gradlew publish -x test"
6065
}

0 commit comments

Comments
 (0)