Publish to Central Maven Repo #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Central Maven Repo | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Configure java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Retrieve Credentials for Publishing Maven package | |
uses: say8425/aws-secrets-manager-actions@v2 | |
with: | |
AWS_DEFAULT_REGION: us-west-2 | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
SECRET_NAME: ${{ secrets.MAVEN_PUBLISHING_CREDENTIALS_SECRET_NAME }} | |
- name: Save GPG private key | |
run: echo ${PGP_PRIVATEKEY_BASE64} | base64 --decode > ${GITHUB_WORKSPACE}/pgpkey.asc | |
- name: Publish to central repository | |
run: mvn clean deploy --batch-mode --activate-profiles release --settings ./settings.xml | |
env: | |
REVAI_ACCESS_TOKEN: ${{ secrets.INTEGRATION_TEST_ACCESS_TOKEN }} | |
PGP_SECRETKEY: keyfile:${{ github.workspace }}/pgpkey.asc | |
PGP_PASSPHRASE: literal:${{ env.PGP_PASSPHRASE }} | |
- name: Cleanup | |
if: always() | |
run: rm ${GITHUB_WORKSPACE}/pgpkey.asc | |
- name: Notify slack fail | |
if: failure() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: revai-alerts-prod | |
status: FAILED | |
color: danger | |
- name: Notify slack success | |
if: success() | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
uses: voxmedia/github-action-slack-notify-build@v1 | |
with: | |
channel: revai-alerts-prod | |
status: SUCCESS | |
color: good |