File tree Expand file tree Collapse file tree 9 files changed +58
-138
lines changed
Expand file tree Collapse file tree 9 files changed +58
-138
lines changed Original file line number Diff line number Diff line change 1+ name : build
2+ on :
3+ push :
4+ branches : [ master ]
5+ tags : [ "*.*.*" ]
6+ jobs :
7+ build :
8+ runs-on : ubuntu-18.04
9+ steps :
10+ - uses : actions/checkout@v2
11+ - uses : actions/setup-java@v1
12+ with :
13+ java-version : 8
14+ env :
15+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
16+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
17+ - name : install
18+ run : mvn --settings .github/workflows/mvnsettings.xml install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -B -V
19+ - name : deploy
20+ run : .github/workflows/deploy.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -e
3+
4+ # update current version number to a TAG version if this is a tag build
5+ if [ " $GITHUB_REF_TYPE " = " tag" ]
6+ then
7+ echo " on a tag -> set pom.xml <version> to $GITHUB_REF_NAME for release"
8+ mvn --settings .github/workflows/mvnsettings.xml org.codehaus.mojo:versions-maven-plugin:2.3:set -DnewVersion=$GITHUB_REF_NAME
9+ else
10+ echo " not on a tag -> keep snapshot version in pom.xml"
11+ fi
12+
13+ # cleanup and generate gpg keys
14+ if [ -d " $HOME /.gnupg" ]; then
15+ shred -v ~ /.gnupg/*
16+ rm -rf ~ /.gnupg
17+ fi
18+
19+ source .github/workflows/gpg.sh
20+
21+ # DEPLOY \o/
22+ mvn clean deploy --settings .github/workflows/mvnsettings.xml -DskipTests=true --batch-mode --update-snapshots
23+
24+ # cleanup gpg keys, just to be safe
25+ find ~ /.gnupg/ -type f -exec shred -v {} \;
26+ rm -rf ~ /.gnupg
Original file line number Diff line number Diff line change @@ -29,15 +29,15 @@ gpg --batch --gen-key gen-key-script
2929# uid Lars K.W. Gohlke <[email protected] >3030# ssb 4096R/CC1613B2 2016-09-08
3131# ssb 4096R/55B7CAA2 2016-09-08
32- gpg -K
33- export GPG_KEYNAME=$( gpg -K | grep ^sec | cut -d/ -f2 | cut -d\ -f1 | head -n1)
32+ gpg -K --keyid-format=short
33+ export GPG_KEYNAME=$( gpg -K --keyid-format=short | grep ^sec | cut -d/ -f2 | cut -d\ -f1 | head -n1)
3434
3535# cleanup local configuration
3636shred gen-key-script
3737
3838# publish the gpg key
39- # (use keyserver.ubuntu.com as travis request keys from this server,
40- # we avoid synchronization issues, while releasing)
39+ # (use a single public key server e.g.keyserver.ubuntu.com
40+ # to avoid synchronization issues, while releasing)
4141echo " Uploading key ${GPG_KEYNAME} to keyserver.ubuntu.com"
4242gpg --keyserver keyserver.ubuntu.com --send-keys ${GPG_KEYNAME}
4343
File renamed without changes.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 413413 <groupId >org.apache.maven.plugins</groupId >
414414 <artifactId >maven-gpg-plugin</artifactId >
415415 <version >${maven-gpg-plugin.version} </version >
416+ <configuration >
417+ <!-- refer to https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#extra-setup-for-pomxml,
418+ required for Github Action runner to prevent gpg from using pinentry programs -->
419+ <gpgArguments >
420+ <arg >--pinentry-mode</arg >
421+ <arg >loopback</arg >
422+ </gpgArguments >
423+ </configuration >
416424 <executions >
417425 <execution >
418426 <id >sign-artifacts</id >
You can’t perform that action at this time.
0 commit comments