Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publish-dry-run.yml #8

Merged
merged 11 commits into from
Apr 13, 2023
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,3 @@ jobs:
cache: maven
- name: verify-${{matrix.name}}
run: mvn verify --settings .settings.xml -Dgpg.skip -B -V
publish-dry-run:
name: publish-dry-run
uses: ./.github/workflows/publish-dry-run.yml
37 changes: 37 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: package

on:
push:
branches:
- main
- develop
workflow_dispatch:

jobs:
package:
name: package
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup-toolchain
uses: actions/setup-java@v2
with:
java-version: 8
distribution: temurin
cache: maven
- name: setup-gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}}
passphrase: ${{secrets.MAVEN_GPG_PASSPHRASE}}
- name: package
env:
MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}}
MAVEN_PASSWORD: ${{secrets.MAVEN_PASSWORD}}
MAVEN_GPG_KEYNAME: ${{secrets.MAVEN_GPG_KEYNAME}}
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}}
run: mvn package -P release --batch-mode --settings .settings.xml -DskipTests=true -DperformRelease=false -Dmaven.deploy.skip=true --update-snapshots -B -V
29 changes: 0 additions & 29 deletions .github/workflows/publish-dry-run.yml

This file was deleted.

22 changes: 14 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: publish-dry-run
name: publish

on:
release:
Expand All @@ -7,13 +7,8 @@ on:
workflow_dispatch:

jobs:
publish-dry-run:
name: publish-dry-run
uses: ./.github/workflows/publish-dry-run.yml
publish:
name: publish
needs:
- publish-dry-run
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -28,10 +23,21 @@ jobs:
distribution: temurin
cache: maven
- name: setup-gpg
run: 'echo -n "${{secrets.MAVEN_GPG_PRIVATE_KEY}}" | base64 --decode | gpg --batch --import'
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}}
passphrase: ${{secrets.MAVEN_GPG_PASSPHRASE}}
- name: publish
env:
MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}}
MAVEN_TOKEN: ${{secrets.MAVEN_TOKEN}}
MAVEN_PASSWORD: ${{secrets.MAVEN_PASSWORD}}
MAVEN_GPG_KEYNAME: ${{secrets.MAVEN_GPG_KEYNAME}}
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}}
run: mvn deploy -P release --batch-mode --settings .settings.xml -DperformRelease=false --update-snapshots -B -V
- name: artifacts
uses: softprops/action-gh-release@v1
with:
files: |
ulidj-*.pom
ulidj-*.jar
ulidj-*.asc
4 changes: 2 additions & 2 deletions .settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>maven</id>
<id>ossrh</id>
<username>${env.MAVEN_USERNAME}</username>
<password>${env.MAVEN_TOKEN}</password>
<password>${env.MAVEN_PASSWORD}</password>
</server>
<server>
<id>gpg.passphrase</id>
Expand Down
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.22.0</version>
<!-- Sticking to this version as it is the latest that supports JDK8 -->
<version>2.16.0</version>
<configuration>
<configFile>${project.basedir}/eclipse-java-google-style.xml</configFile>
<encoding>${project.build.sourceEncoding}</encoding>
Expand Down Expand Up @@ -166,6 +167,7 @@
<goal>sign</goal>
</goals>
<configuration>
<keyname>${env.MAVEN_GPG_KEYNAME}</keyname>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand Down