Skip to content

Commit

Permalink
Merge pull request #40 from rapid7/PD-45855
Browse files Browse the repository at this point in the history
PD-45855: Use github actions for releases
  • Loading branch information
eromani-r7 authored Nov 7, 2024
2 parents de3334d + f050742 commit bef9a58
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish a release to the Maven Central Repository
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Publish release
run: mvn -Dresume=false -Prelease -B -V -U release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
25 changes: 25 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish a snapshot to the Maven Central Repository
on:
push:
branches: [ "master" ]
jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
- name: Publish snapshot
run: mvn deploy -B -C -U -Dprod -Pstyle-enforcer
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<description>Extracts, parses, and analyzes Docker images into Java objects with JSON mappings.</description>

<scm>
<connection>scm:git:git@github.com:rapid7/docker-image-analyzer.git</connection>
<developerConnection>scm:git:git@github.com:rapid7/docker-image-analyzer.git</developerConnection>
<connection>scm:git:https://github.com/rapid7/docker-image-analyzer.git</connection>
<developerConnection>scm:git:https://github.com/rapid7/docker-image-analyzer.git</developerConnection>
<url>https://github.com/rapid7/docker-image-analyzer</url>
<tag>0.2.7</tag>
</scm>
Expand Down Expand Up @@ -335,7 +335,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -345,6 +345,13 @@
</goals>
</execution>
</executions>
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>

<plugin>
Expand Down

0 comments on commit bef9a58

Please sign in to comment.