Skip to content

Commit

Permalink
Merge pull request #17 from ButterCMS/fix/use-gpg-properly
Browse files Browse the repository at this point in the history
fix: Update publish flow
  • Loading branch information
ViolanteCodes authored Aug 21, 2024
2 parents f851c94 + 7ecd255 commit 7b2e450
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ jobs:
cache: 'maven'
cache-dependency-path: ./pom.xml
server-id: ossrh # This id should match with the id in your pom.xml or settings.xml
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_TOKEN }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PWD }}
server-username: OSSRH_USERNAME # Env variable for username in deploy (Passes the environment variable name, not the value)
server-password: OSSRH_TOKEN # Env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_PWD # Env variable for GPG private key passphrase

- name: Build with Maven Wrapper
run: ./mvnw clean install

- name: Deploy to Apache Maven
run: ./mvnw deploy -P release -Dgpg.skip=false # Using the profile `release` for using the necessary dependencies
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_PWD: ${{ secrets.GPG_PWD }}
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Ensuring passphrase is provided directly from an environment variable -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit 7b2e450

Please sign in to comment.