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

PD-45855: Use github actions for releases #40

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading