Skip to content

Commit 422b920

Browse files
committed
Split publish and build pipeline.
1 parent d37b6a7 commit 422b920

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ jobs:
3030
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v1.3.0-rc.1/install/install.sh
3131
DAPR_CLI_REF:
3232
DAPR_REF:
33-
OSSRH_USER_TOKEN: ${{ secrets.OSSRH_USER_TOKEN }}
34-
OSSRH_PWD_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
35-
GPG_KEY: ${{ secrets.GPG_KEY }}
36-
GPG_PWD: ${{ secrets.GPG_PWD }}
3733
steps:
3834
- uses: actions/checkout@v2
3935
- name: Set up OpenJDK ${{ env.JDK_VER }}
@@ -117,22 +113,41 @@ jobs:
117113
with:
118114
name: report-dapr-java-sdk-actors
119115
path: sdk-actors/target/jacoco-report/
120-
- name: Get pom parent version
121-
run: |
122-
PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
123-
echo "PARENT_VERSION=$PARENT_VERSION" >> $GITHUB_ENV
124-
- name: Is SNAPSHOT release ?
125-
if: contains(github.ref, 'master') && contains(env.PARENT_VERSION, '-SNAPSHOT')
126-
run: |
127-
echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV
128-
- name: Is Release or RC version ?
129-
if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, '-SNAPSHOT')
130-
run: |
131-
echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV
132-
- name: Publish to ossrh
133-
if: env.DEPLOY_OSSRH == 'true'
134-
run: |
135-
echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg
136-
export GPG_TTY=$(tty)
137-
gpg --batch --import private-key.gpg
138-
mvn -V -B -Dgpg.skip=false -s settings.xml deploy -pl \!examples
116+
publish:
117+
runs-on: ubuntu-latest
118+
needs: build
119+
env:
120+
JDK_VER: 11
121+
OSSRH_USER_TOKEN: ${{ secrets.OSSRH_USER_TOKEN }}
122+
OSSRH_PWD_TOKEN: ${{ secrets.OSSRH_PWD_TOKEN }}
123+
GPG_KEY: ${{ secrets.GPG_KEY }}
124+
GPG_PWD: ${{ secrets.GPG_PWD }}
125+
steps:
126+
- uses: actions/checkout@v2
127+
- name: Set up OpenJDK ${{ env.JDK_VER }}
128+
uses: actions/[email protected]
129+
with:
130+
distribution: 'adopt'
131+
java-version: ${{ env.JDK_VER }}
132+
- name: Get pom parent version
133+
run: |
134+
PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
135+
echo "PARENT_VERSION=$PARENT_VERSION" >> $GITHUB_ENV
136+
- name: Is SNAPSHOT release ?
137+
if: contains(github.ref, 'master') && contains(env.PARENT_VERSION, '-SNAPSHOT')
138+
run: |
139+
echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV
140+
- name: Is Release or RC version ?
141+
if: startswith(github.ref, 'refs/tags/v') && !contains(env.PARENT_VERSION, '-SNAPSHOT')
142+
run: |
143+
echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV
144+
- name: Install jars
145+
if: env.DEPLOY_OSSRH == 'true'
146+
run: mvn clean install -q
147+
- name: Publish to ossrh
148+
if: env.DEPLOY_OSSRH == 'true'
149+
run: |
150+
echo ${{ secrets.GPG_PRIVATE_KEY }} | base64 -d > private-key.gpg
151+
export GPG_TTY=$(tty)
152+
gpg --batch --import private-key.gpg
153+
mvn -V -B -Dgpg.skip=false -s settings.xml deploy -pl \!examples

0 commit comments

Comments
 (0)