File tree Expand file tree Collapse file tree 4 files changed +111
-0
lines changed Expand file tree Collapse file tree 4 files changed +111
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+ on :
3
+ push :
4
+ branches : ['**']
5
+ pull_request :
6
+ branches : ['**']
7
+
8
+ jobs :
9
+ build :
10
+ if : github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name
11
+ name : Build
12
+ runs-on : ' ubuntu-latest'
13
+ steps :
14
+ - uses : actions/checkout@v3
15
+ - uses : actions/setup-java@v3
16
+ with :
17
+ distribution : ' temurin'
18
+ java-version : 21
19
+ - uses : gradle/wrapper-validation-action@v1
20
+ - uses : gradle/gradle-build-action@v2
21
+ with :
22
+ arguments : build --stacktrace
Original file line number Diff line number Diff line change
1
+ name : Deploy
2
+ on :
3
+ push :
4
+ tags : ['v*']
5
+
6
+ jobs :
7
+ deploy :
8
+ name : Deploy
9
+ runs-on : ' ubuntu-latest'
10
+ steps :
11
+ - uses : actions/checkout@v3
12
+ - uses : actions/setup-java@v3
13
+ with :
14
+ distribution : ' temurin'
15
+ java-version : 21
16
+ - uses : gradle/wrapper-validation-action@v1
17
+ - uses : gradle/gradle-build-action@v2
18
+ name : Deploy
19
+ with :
20
+ arguments : build publish --stacktrace
21
+ env :
22
+ ORG_GRADLE_PROJECT_papermcUsername : ${{ secrets.DEPLOY_USER }}
23
+ ORG_GRADLE_PROJECT_papermcPassword : ${{ secrets.DEPLOY_PASS }}
24
+ - name : Get tag name
25
+ id : get_tag
26
+ shell : bash
27
+ run : |
28
+ tag_name="$(echo $GITHUB_REF | cut -d / -f 3)"
29
+ echo "tag=$tag_name" >> $GITHUB_OUTPUT
30
+ - name : Create GitHub Release
31
+ uses : softprops/action-gh-release@v1
32
+ with :
33
+ tag_name : ${{ steps.get_tag.outputs.tag }}
34
+ name : ' Release ${{ steps.get_tag.outputs.tag }}'
35
+ prerelease : false
36
+ draft : false
37
+ files : |
38
+ build/libs/*.jar
39
+ codebook-cli/build/libs/*-all.jar
40
+ env :
41
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Deploy Snapshot
2
+ on :
3
+ push :
4
+ branches : ['main']
5
+ paths-ignore :
6
+ - ' README.md'
7
+ - ' .editorconfig'
8
+ - ' .gitignore'
9
+ - ' .gitattributes'
10
+
11
+ jobs :
12
+ deploy :
13
+ name : Deploy Snapshot
14
+ runs-on : ' ubuntu-latest'
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+ - uses : actions/setup-java@v3
18
+ with :
19
+ distribution : ' temurin'
20
+ java-version : 21
21
+ - uses : gradle/wrapper-validation-action@v1
22
+ - uses : gradle/gradle-build-action@v2
23
+ name : Setup Gradle
24
+ - name : Get project version
25
+ id : get_version
26
+ shell : bash
27
+ run : |
28
+ project_version=$(./gradlew -q --console=plain printVersion)
29
+ echo "version=$project_version" >> $GITHUB_OUTPUT
30
+ - name : Deploy snapshot version
31
+ if : endsWith(steps.get_version.outputs.version, '-SNAPSHOT')
32
+ run : ./gradlew build publish --stacktrace
33
+ env :
34
+ ORG_GRADLE_PROJECT_papermcUsername : ${{ secrets.DEPLOY_USER }}
35
+ ORG_GRADLE_PROJECT_papermcPassword : ${{ secrets.DEPLOY_PASS }}
Original file line number Diff line number Diff line change @@ -63,6 +63,19 @@ publishing {
63
63
artifactId = rootProject.name
64
64
from(components[" java" ])
65
65
}
66
+
67
+ repositories {
68
+ val isSnapshot = rootProject.version.toString().endsWith(" -SNAPSHOT" )
69
+ val url = if (isSnapshot) {
70
+ " https://repo.papermc.io/repository/maven-snapshots/"
71
+ } else {
72
+ " https://repo.papermc.io/repository/maven-releases/"
73
+ }
74
+ maven(url) {
75
+ name = " papermc"
76
+ credentials(PasswordCredentials ::class )
77
+ }
78
+ }
66
79
}
67
80
68
81
tasks.register(" printVersion" ) {
You can’t perform that action at this time.
0 commit comments