Skip to content

Commit

Permalink
Remove maven-settings.xml.gpg
Browse files Browse the repository at this point in the history
This removes the encrypted file from the repository and uses the recommended approach in GitHub

See https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-the-maven-central-repository
  • Loading branch information
gastaldi committed Dec 22, 2021
1 parent 27cf9a3 commit ed7570f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Binary file removed .github/release/maven-settings.xml.gpg
Binary file not shown.
23 changes: 11 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ jobs:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- uses: actions/setup-java@v1.4.3
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Configure Git author
run: |
Expand All @@ -48,12 +45,14 @@ jobs:
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
git checkout -b release
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease -s maven-settings.xml
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

- name: Push changes to ${{github.base_ref}}
uses: ad-m/[email protected]
Expand Down

0 comments on commit ed7570f

Please sign in to comment.