2021-05-01 17:32:15 +00:00
|
|
|
name: Publish package to the Maven Central Repository
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Maven Central Repository
|
2023-09-18 19:38:12 +00:00
|
|
|
uses: actions/setup-java@v3
|
2021-05-01 17:32:15 +00:00
|
|
|
with:
|
2023-09-18 19:38:12 +00:00
|
|
|
distribution: 'temurin' # See 'Supported distributions' for available options
|
|
|
|
java-version: '17'
|
2021-05-01 17:32:15 +00:00
|
|
|
server-id: ossrh
|
|
|
|
server-username: MAVEN_USERNAME
|
|
|
|
server-password: MAVEN_PASSWORD
|
|
|
|
- id: install-secret-key
|
|
|
|
name: Install gpg secret key
|
|
|
|
run: |
|
2021-08-02 06:30:28 +00:00
|
|
|
cat <(echo -e "${{ secrets.OSSRH_GPG_KEY }}") | gpg --batch --import
|
|
|
|
gpg --list-secret-keys --keyid-format LONG
|
2021-05-01 17:32:15 +00:00
|
|
|
- id: publish-to-central
|
|
|
|
name: Publish to Central Repository
|
|
|
|
env:
|
|
|
|
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
|
|
|
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }}
|
|
|
|
mvn \
|
|
|
|
--no-transfer-progress \
|
|
|
|
--batch-mode \
|
|
|
|
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_KEY_PASSWORD }} \
|
2021-08-02 06:30:28 +00:00
|
|
|
-P ossrh \
|
2021-05-01 20:01:44 +00:00
|
|
|
clean deploy
|
2021-05-01 20:05:30 +00:00
|
|
|
- id: push-new-version
|
2021-08-02 06:30:28 +00:00
|
|
|
name: push new version
|
2021-05-01 20:01:44 +00:00
|
|
|
run: |
|
|
|
|
git clone https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{github.repository}}.git
|
|
|
|
cd keycloak-mail-whitelisting
|
|
|
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
mvn -B versions:set -DnextSnapshot -DgenerateBackupPoms=false
|
|
|
|
git commit -a -m"Prepare new version"
|
2021-05-01 20:05:30 +00:00
|
|
|
git push
|