Skip to content

Commit aac9049

Browse files
authored
Merge pull request #8 from azam/develop
Fix publish-dry-run.yml
2 parents 5e2b275 + 7e17ced commit aac9049

File tree

6 files changed

+56
-43
lines changed

6 files changed

+56
-43
lines changed

.github/workflows/build.yml

-3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,3 @@ jobs:
4949
cache: maven
5050
- name: verify-${{matrix.name}}
5151
run: mvn verify --settings .settings.xml -Dgpg.skip -B -V
52-
publish-dry-run:
53-
name: publish-dry-run
54-
uses: ./.github/workflows/publish-dry-run.yml

.github/workflows/package.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
workflow_dispatch:
9+
10+
jobs:
11+
package:
12+
name: package
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
packages: write
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v3
20+
- name: setup-toolchain
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: 8
24+
distribution: temurin
25+
cache: maven
26+
- name: setup-gpg
27+
uses: crazy-max/ghaction-import-gpg@v5
28+
with:
29+
gpg_private_key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}}
30+
passphrase: ${{secrets.MAVEN_GPG_PASSPHRASE}}
31+
- name: package
32+
env:
33+
MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}}
34+
MAVEN_PASSWORD: ${{secrets.MAVEN_PASSWORD}}
35+
MAVEN_GPG_KEYNAME: ${{secrets.MAVEN_GPG_KEYNAME}}
36+
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}}
37+
run: mvn package -P release --batch-mode --settings .settings.xml -DskipTests=true -DperformRelease=false -Dmaven.deploy.skip=true --update-snapshots -B -V

.github/workflows/publish-dry-run.yml

-29
This file was deleted.

.github/workflows/publish.yml

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish-dry-run
1+
name: publish
22

33
on:
44
release:
@@ -7,13 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
publish-dry-run:
11-
name: publish-dry-run
12-
uses: ./.github/workflows/publish-dry-run.yml
1310
publish:
1411
name: publish
15-
needs:
16-
- publish-dry-run
1712
runs-on: ubuntu-latest
1813
permissions:
1914
contents: write
@@ -28,10 +23,21 @@ jobs:
2823
distribution: temurin
2924
cache: maven
3025
- name: setup-gpg
31-
run: 'echo -n "${{secrets.MAVEN_GPG_PRIVATE_KEY}}" | base64 --decode | gpg --batch --import'
26+
uses: crazy-max/ghaction-import-gpg@v5
27+
with:
28+
gpg_private_key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}}
29+
passphrase: ${{secrets.MAVEN_GPG_PASSPHRASE}}
3230
- name: publish
3331
env:
3432
MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}}
35-
MAVEN_TOKEN: ${{secrets.MAVEN_TOKEN}}
33+
MAVEN_PASSWORD: ${{secrets.MAVEN_PASSWORD}}
34+
MAVEN_GPG_KEYNAME: ${{secrets.MAVEN_GPG_KEYNAME}}
3635
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}}
3736
run: mvn deploy -P release --batch-mode --settings .settings.xml -DperformRelease=false --update-snapshots -B -V
37+
- name: artifacts
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
files: |
41+
ulidj-*.pom
42+
ulidj-*.jar
43+
ulidj-*.asc

.settings.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<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">
33
<servers>
44
<server>
5-
<id>maven</id>
5+
<id>ossrh</id>
66
<username>${env.MAVEN_USERNAME}</username>
7-
<password>${env.MAVEN_TOKEN}</password>
7+
<password>${env.MAVEN_PASSWORD}</password>
88
</server>
99
<server>
1010
<id>gpg.passphrase</id>

pom.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
<plugin>
9494
<groupId>net.revelc.code.formatter</groupId>
9595
<artifactId>formatter-maven-plugin</artifactId>
96-
<version>2.22.0</version>
96+
<!-- Sticking to this version as it is the latest that supports JDK8 -->
97+
<version>2.16.0</version>
9798
<configuration>
9899
<configFile>${project.basedir}/eclipse-java-google-style.xml</configFile>
99100
<encoding>${project.build.sourceEncoding}</encoding>
@@ -166,6 +167,7 @@
166167
<goal>sign</goal>
167168
</goals>
168169
<configuration>
170+
<keyname>${env.MAVEN_GPG_KEYNAME}</keyname>
169171
<!-- Prevent gpg from using pinentry programs -->
170172
<gpgArguments>
171173
<arg>--pinentry-mode</arg>

0 commit comments

Comments
 (0)