Skip to content

Commit 94ba8cd

Browse files
authored
Add release workflow following Kermit's workflows (#20)
1 parent 4483e17 commit 94ba8cd

File tree

2 files changed

+59
-21
lines changed

2 files changed

+59
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-java@v2
1212
with:
1313
distribution: "adopt"
14-
java-version: "11"
14+
java-version: "17"
1515

1616
- name: Validate Gradle Wrapper
1717
uses: gradle/wrapper-validation-action@v1
@@ -35,28 +35,9 @@ jobs:
3535
- name: Publish Artifacts
3636
run: ./gradlew publish --no-daemon --stacktrace --no-build-cache
3737
env:
38-
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
3938
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
40-
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
4139
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
42-
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
4340
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
4441

45-
- uses: touchlab/read-property@main
46-
id: version_name
47-
with:
48-
file: ./gradle.properties
49-
property: VERSION_NAME
50-
51-
- name: Print versionBasePropertyValue
52-
id: output
53-
run: echo "${{ steps.version_name.outputs.propVal }}"
54-
55-
- name: Create Release
56-
if: ${{ contains(steps.version_name.outputs.propVal, 'SNAPSHOT') == false }}
57-
uses: touchlab/[email protected]
58-
with:
59-
tag: ${{ steps.version_name.outputs.propVal }}
60-
6142
env:
62-
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
43+
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: release
2+
on: workflow_dispatch
3+
4+
jobs:
5+
release:
6+
runs-on: macos-latest
7+
steps:
8+
- name: Checkout the repo
9+
uses: actions/checkout@v2
10+
11+
- uses: touchlab/[email protected]
12+
id: version-name
13+
with:
14+
file: ./gradle.properties
15+
property: VERSION_NAME
16+
17+
- name: Echo Version
18+
run: echo "${{ steps.version-name.outputs.propVal }}"
19+
20+
- uses: actions/setup-java@v2
21+
with:
22+
distribution: "adopt"
23+
java-version: "17"
24+
- name: Validate Gradle Wrapper
25+
uses: gradle/wrapper-validation-action@v1
26+
- name: Cache gradle
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/.gradle/caches
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-
33+
- name: Cache konan
34+
uses: actions/cache@v2
35+
with:
36+
path: ~/.konan
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
- name: Finish Maven Central Release
41+
run: ./gradlew closeAndReleaseRepository --no-daemon --stacktrace --no-build-cache
42+
env:
43+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
44+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
45+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
46+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
47+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
48+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
49+
50+
- name: Create Release
51+
if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }}
52+
uses: touchlab/[email protected]
53+
with:
54+
tag: ${{ steps.version-name.outputs.propVal }}
55+
56+
env:
57+
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

0 commit comments

Comments
 (0)