File tree Expand file tree Collapse file tree 4 files changed +62
-1
lines changed
Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 1010 runs-on : ubuntu-latest
1111 steps :
1212 - name : Checkout latest code
13- uses : actions/checkout@v2
13+ uses : actions/checkout@v3
1414
1515 - name : Set up JDK 11
1616 uses : actions/setup-java@v3
Original file line number Diff line number Diff line change 1+ name : Publish release
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout latest code
13+ uses : actions/checkout@v3
14+
15+ - name : Set up JDK 11
16+ uses : actions/setup-java@v3
17+ with :
18+ distribution : " adopt"
19+ java-version : 11
20+
21+ - name : Setup build cache
22+ 23+ with :
24+ path : ~/.gradle/caches
25+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
26+ restore-keys : |
27+ ${{ runner.os }}-gradle-
28+
29+ - name : Publish artifact
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32+
33+ run : |
34+ NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
35+ echo "New version: ${NEW_VERSION}"
36+ echo "Github username: ${GITHUB_ACTOR}"
37+ ./gradlew -Pversion=${NEW_VERSION} publish
Original file line number Diff line number Diff line change 1+ group =com.featurevisor
2+ version =0.0.1-SNAPSHOT
Original file line number Diff line number Diff line change @@ -11,13 +11,35 @@ plugins {
1111
1212 // Apply the java-library plugin for API and implementation separation.
1313 `java- library`
14+
15+ `maven- publish`
1416}
1517
1618repositories {
1719 // Use Maven Central for resolving dependencies.
1820 mavenCentral()
1921}
2022
23+ publishing {
24+ publications {
25+ create<MavenPublication >(" default" ) {
26+ from(components[" java" ])
27+ // Include any other artifacts here, like javadocs
28+ }
29+ }
30+
31+ repositories {
32+ maven {
33+ name = " GitHubPackages"
34+ url = uri(" https://maven.pkg.github.com/featurevisor/featurevisor-kotlin" )
35+ credentials {
36+ username = System .getenv(" GITHUB_ACTOR" )
37+ password = System .getenv(" GITHUB_TOKEN" )
38+ }
39+ }
40+ }
41+ }
42+
2143dependencies {
2244 // Use the Kotlin JUnit 5 integration.
2345 testImplementation(" org.jetbrains.kotlin:kotlin-test-junit5" )
You can’t perform that action at this time.
0 commit comments