mirror of https://github.com/dapr/java-sdk.git
[CD] Conditional SNAPSHOT and final release (#115)
* Release pkg based on tag and branch * Update build.yml * Update build.yml
This commit is contained in:
parent
ed1e91a575
commit
8bb452f66a
|
@ -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
|
||||
mvn -V -B -Dgpg.skip=false -s settings.xml deploy
|
||||
|
|
Loading…
Reference in New Issue