maven-release.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Copyright 2017-2020 Adobe.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
  17. name: Maven Release
  18. on: workflow_dispatch
  19. jobs:
  20. build:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - uses: actions/checkout@v3
  24. with:
  25. fetch-depth: 0
  26. - name: Set up JDK
  27. uses: actions/setup-java@v3
  28. with:
  29. java-version: 17
  30. distribution: 'adopt'
  31. # The release build pushes a Docker image to Docker Hub, so we need to log in
  32. - name: Perform docker login
  33. env:
  34. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
  35. DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
  36. run: echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
  37. # Import GPG key used during the release to sign the artifacts (required by Sonatype)
  38. - name: Import GPG key
  39. env:
  40. GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
  41. GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
  42. run: |
  43. echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
  44. echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
  45. # The release plugin creates two commits, let's attribute them nicely to the Adobe Bot
  46. - name: Configure git user for release commits
  47. env:
  48. X_GITHUB_USERNAME: ${{ secrets.ADOBE_BOT_GITHUB_USERNAME }}
  49. run: |
  50. git config user.email "Grp-opensourceoffice@adobe.com"
  51. git config user.name "${X_GITHUB_USERNAME}"
  52. - name: Set up QEMU
  53. uses: docker/setup-qemu-action@v2
  54. # Run the actual Maven command
  55. - name: Release with Maven
  56. env:
  57. GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
  58. ADOBE_BOT_GITHUB_USERNAME: ${{ secrets.ADOBE_BOT_GITHUB_USERNAME }}
  59. ADOBE_BOT_GITHUB_PASSWORD: ${{ secrets.ADOBE_BOT_GITHUB_PASSWORD }}
  60. SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
  61. SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
  62. run: ./mvnw -B -V --settings ./.github/workflows/settings.xml release:prepare release:perform