This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
Release to maven central #47
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: Release to maven central | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- run: | | |
git config --global user.name 'eclipse-uprotocol-bot' | |
git config --global user.email 'uprotocol-bot@eclipse.org' | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v3 | |
with: # configure settings.xml | |
distribution: 'temurin' | |
java-version: '11' | |
server-id: ossrh | |
server-username: OSSRH_USER | |
server-password: OSSRH_PASSWORD | |
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
- name: Stage to Nexus and Release to Maven central | |
run: | | |
mvn -B release:clean release:prepare -P release release:perform | |
# mvn -B clean release:prepare release:perform nexus-staging:promote -DstagingRepositoryId=ossrh -DbuildPromotionProfileId=ossrh | |
# mvn -B clean release:perform nexus-staging:promote -DstagingRepositoryId=ossrh -DbuildPromotionProfileId=ossrh | |
env: | |
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} | |
GH_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- if: cancelled() || failure() | |
run: | | |
mvn -B release:rollback nexus-staging:drop | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} |