From ef052836885906423dbd26f871ef26b96594c38f Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 16 Jan 2020 19:09:57 -0800 Subject: [PATCH 1/3] Release pkg based on tag and branch --- .github/workflows/build.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49f8af5072..e7a39dee0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,14 +58,20 @@ jobs: path: sdk-actors/target/jacoco-report/ - name: Packaging jars run: mvn package - - name: Import GPG private key - if: github.event_name != 'pull_request' + - name: Get pom parent version + run: | + PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + echo "##[set-env name=PARENT_VERSION;]$PARENT_VERSION" + - name: Is SNAPSHOT release? + if: contains(github.ref, 'release-') && contains(env.PARENT_VERSION, "-SNAPSHOT") + run: echo "##[set-env name=DEPLOY_OSSRH;]true" + - name: Is Final release? + if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, "-SNAPSHOT") + run: echo "##[set-env name=DEPLOY_OSSRH;]true" + - name: Publish to ossrh + if: env.DEPLOY_OSSRH == "true" run: | echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg export GPG_TTY=$(tty) gpg --batch --import private-key.gpg - - name: deploy to OSSRH - if: github.event_name != 'pull_request' - run: | - export GPG_TTY=$(tty) mvn -V -B -Dgpg.skip=false -s settings.xml deploy \ No newline at end of file From 85ba0c3a815c5f63046fa6f027bea22e3a469210 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 16 Jan 2020 19:14:18 -0800 Subject: [PATCH 2/3] Update build.yml --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7a39dee0a..f5a5cccb02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,10 +63,10 @@ jobs: PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) echo "##[set-env name=PARENT_VERSION;]$PARENT_VERSION" - name: Is SNAPSHOT release? - if: contains(github.ref, 'release-') && contains(env.PARENT_VERSION, "-SNAPSHOT") + if: contains(github.ref, 'release-') && contains(env.PARENT_VERSION, '-SNAPSHOT') run: echo "##[set-env name=DEPLOY_OSSRH;]true" - name: Is Final release? - if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, "-SNAPSHOT") + if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, '-SNAPSHOT') run: echo "##[set-env name=DEPLOY_OSSRH;]true" - name: Publish to ossrh if: env.DEPLOY_OSSRH == "true" @@ -74,4 +74,4 @@ jobs: echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg export GPG_TTY=$(tty) gpg --batch --import private-key.gpg - mvn -V -B -Dgpg.skip=false -s settings.xml deploy \ No newline at end of file + mvn -V -B -Dgpg.skip=false -s settings.xml deploy From db54ef7c49d91f2c0d79faf61d81d067c4c6dae6 Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Thu, 16 Jan 2020 19:16:03 -0800 Subject: [PATCH 3/3] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5a5cccb02..ffc0e2b844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, '-SNAPSHOT') run: echo "##[set-env name=DEPLOY_OSSRH;]true" - name: Publish to ossrh - if: env.DEPLOY_OSSRH == "true" + if: env.DEPLOY_OSSRH == 'true' run: | echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg export GPG_TTY=$(tty)