Skip to content

Commit

Permalink
setup github action to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
ofir-popowski committed Sep 18, 2022
1 parent cf55305 commit 0296139
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: deploy
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-20.04
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_KEY: ${{ secrets.GPG_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
steps:
- name: Check Out Source Code
uses: actions/checkout@v2

- name: Set up Java 8
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'

- name: Prepare deploy
shell: bash
env:
CODESIGNING: ${{ secrets.CODESIGNING }}
run: |
echo 'Run deploy preparation ' ${GITHUB_REF##*/}
openssl aes-256-cbc -in release/codesigning.asc.enc -out release/codesigning.asc -d -k $CODESIGNING
gpg --batch --fast-import release/codesigning.asc
rm release/codesigning.asc
./mvnw versions:set -DnewVersion=${GITHUB_REF#refs/tags/}
- name: Deploy
run: |
echo 'Deploy'
./mvnw deploy --settings release/settings.xml
echo 'Deploy finished successfully'
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.6.3</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<serverId>ossrh-nexus</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
Expand Down
Binary file added release/codesigning.asc.enc
Binary file not shown.
23 changes: 23 additions & 0 deletions release/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<settings>
<servers>
<server>
<id>ossrh-nexus</id>
<username>${env.OSSRH_USERNAME}</username>
<password>${env.OSSRH_PASSWORD}</password>
</server>
</servers>

<profiles>
<profile>
<id>ossrh-nexus</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

0 comments on commit 0296139

Please sign in to comment.