Skip to content

Commit

Permalink
Finish release in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Sep 20, 2023
1 parent 10d5123 commit 5467a7e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Read gradle.properties
id: props
uses: juliangruber/read-file-action@v1
with:
path: ./gradle.properties

- uses: actions-ecosystem/action-regex-match@v2
id: version-match
with:
text: ${{ steps.props.outputs.content }}
regex: '^VERSION_NAME=(.*?)$'
flags: gm

- name: Echo Version
run: echo ${{ steps.version-match.outputs.group1 }}

- uses: actions/setup-java@v2
with:
distribution: "adopt"
Expand Down Expand Up @@ -56,11 +40,5 @@ jobs:
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}

- name: Create Release
if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }}
uses: touchlab/release-action@v1.10.0
with:
tag: ${{ steps.version-match.outputs.group1 }}

env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: release
on: workflow_dispatch

jobs:
deploy:
runs-on: macos-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2

- uses: touchlab/read-property@0.1
id: version-name
with:
file: ./gradle.properties
property: VERSION_NAME

- name: Echo Version
run: echo "${{ steps.version-name.outputs.propVal }}"

- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "17"
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Cache gradle
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache konan
uses: actions/cache@v2
with:
path: ~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Finish Maven Central Release
run: ./gradlew closeAndReleaseRepository --no-daemon --stacktrace --no-build-cache
env:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}

# - name: Create Release
# if: ${{ contains(steps.version-match.outputs.group1, 'SNAPSHOT') == false }}
# uses: touchlab/release-action@v1.10.0
# with:
# tag: ${{ steps.version-name.outputs.propVal }}

env:
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

0 comments on commit 5467a7e

Please sign in to comment.