Skip to content

Commit fca32de

Browse files
authored
Add release workflow following Kermit's workflows (#64)
1 parent 2d05c41 commit fca32de

File tree

2 files changed

+59
-22
lines changed

2 files changed

+59
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,6 @@ jobs:
2020
- name: Checkout the repo
2121
uses: actions/checkout@v2
2222

23-
- name: Read gradle.properties
24-
id: props
25-
uses: juliangruber/read-file-action@v1
26-
with:
27-
path: ./gradle.properties
28-
29-
- uses: actions-ecosystem/action-regex-match@v2
30-
id: version-match
31-
with:
32-
text: ${{ steps.props.outputs.content }}
33-
regex: '^VERSION_NAME=(.*?)$'
34-
flags: gm
35-
36-
- name: Echo Version
37-
run: echo ${{ steps.version-match.outputs.group1 }}
38-
3923
- uses: actions/setup-java@v2
4024
with:
4125
distribution: "adopt"
@@ -67,11 +51,5 @@ jobs:
6751
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
6852
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
6953

70-
- name: Create Release
71-
if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }}
72-
uses: touchlab/[email protected]
73-
with:
74-
tag: ${{ steps.version-match.outputs.group1 }}
75-
7654
env:
7755
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
34+
- name: Cache konan
35+
uses: actions/cache@v2
36+
with:
37+
path: ~/.konan
38+
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
39+
restore-keys: |
40+
${{ runner.os }}-gradle-
41+
42+
- name: Finish Maven Central Release
43+
run: ./gradlew closeAndReleaseRepository --no-daemon --stacktrace --no-build-cache
44+
env:
45+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
46+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
47+
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
48+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
49+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
50+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
51+
52+
- name: Create Release
53+
if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }}
54+
uses: touchlab/[email protected]
55+
with:
56+
tag: ${{ steps.version-name.outputs.propVal }}
57+
58+
env:
59+
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

0 commit comments

Comments
 (0)