Skip to content

Commit

Permalink
fix release (via #223)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Eroshenko authored Jan 26, 2022
1 parent 18b2899 commit f306797
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
name: "Build JDK 1.8"
name: "Build"
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish
name: Publish Release

on:
release:
Expand All @@ -16,26 +16,26 @@ jobs:
distribution: 'zulu'
java-version: 8.0.x

- name: Set up GPG
run: echo -n "${GPG_PRIVATE_KEY}" | base64 --decode > ${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set up Maven
uses: s4u/[email protected]
with:
servers: '[{"id": "ossrh", "username": "${{secrets.OSSRH_USERNAME}}", "password": "${{secrets.OSSRH_PASSWORD}}"}]'

- name: Set up GPG
run: |
export GPG_TTY=$(tty)
echo -n "${GPG_PRIVATE_KEY}" | base64 --decode | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: "Maven Build"
run: ./mvnw -Dinvoker.skip=true install

- name: "Maven Publish"
run: |
./mvnw -Dinvoker.skip=true deploy \
-Dsigning.keyId=${GPG_KEY_ID} \
-Dsigning.password=${GPG_PASSPHRASE} \
-Dsigning.secretKeyRingFile=${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
./mvnw -Dinvoker.skip=true -Pgpg deploy \
-Dgpg.keyname=${GPG_KEY_ID} \
-Dgpg.passphrase=${GPG_PASSPHRASE} \
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Perform Release

on:
workflow_dispatch:
Expand Down
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,30 @@
</dependencies>

<profiles>
<profile>
<id>gpg</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>it</id>
<activation>
Expand Down

0 comments on commit f306797

Please sign in to comment.