Skip to content

Commit

Permalink
Fix oss snapshot deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
oranheim committed Sep 27, 2024
1 parent 274abaa commit 6241e90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build-and-release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,21 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Prepare Maven settings.xml
run: |
cat "${{ github.workspace }}/.github/settings.xml" > ~/.m2/settings.xml
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package

- name: Import GPG key
run: |
echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --import --batch
- name: Publish Snapshot to OSS SonaType
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
OSSRH_GPG_SECRET_KEY_ID: ${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
mvn --batch-mode --no-transfer-progress deploy \
-DskipTests \
-Dgpg.keyname=${OSSRH_GPG_SECRET_KEY_ID} \
-Dgpg.passphrase=${OSSRH_GPG_SECRET_KEY_PASSWORD}
-P oss-sonatype
- name: Notify on success
if: success()
Expand Down
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@
</dependencies>

<profiles>
<profile>
<id>oss-sonatype</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<goals>deploy</goals>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release</id>
<build>
Expand Down

0 comments on commit 6241e90

Please sign in to comment.