Release #48
This file contains hidden or 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
| # This workflow will build a package using Maven and then publish it to Maven central when a release is created | |
| # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| type: boolean | |
| required: true | |
| default: false | |
| description: "If true, no Git changes will be made and no artifacts will be uploaded." | |
| release_version: | |
| type: string | |
| required: false | |
| description: "Set the release version. If not specified, the version in the pom.xml will be released." | |
| development_version: | |
| type: string | |
| required: false | |
| description: "Set the next development version. If not specified, the minor version will be incremented automatically." | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| server-id: central | |
| server-username: MAVEN_CENTRAL_TOKEN_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN_PASSWORD | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Publish to Maven central | |
| run: | | |
| git config user.name Shapeshifter | |
| git config user.email shapeshifter@lfenergy.org | |
| mvn -B -DdryRun=${{inputs.dry_run}} -DreleaseVersion=${{inputs.release_version}} -DdevelopmentVersion=${{inputs.development_version}} release:prepare release:perform | |
| env: | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
| MAVEN_CENTRAL_TOKEN_USERNAME: ${{ vars.MAVEN_CENTRAL_TOKEN_USERNAME }} | |
| MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} |