[maven-release-plugin] prepare release v10 #14
Workflow file for this run
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
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| name: Deploy Tagged Release | |
| env: | |
| MAVEN_VERSION: 3.9.8 | |
| JAVA_DISTRO: temurin | |
| JAVA_VERSION_FILE: .java-version | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| jobs: | |
| deploy-to-nexus: | |
| name: Maven Central Deployment | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| actions: read | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| submodules: recursive | |
| # ------------------------- | |
| # Java | |
| # ------------------------- | |
| - name: Set up Maven | |
| uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | |
| with: | |
| maven-version: ${{ env.MAVEN_VERSION }} | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e | |
| with: | |
| java-version-file: ${{ env.JAVA_VERSION_FILE }} | |
| distribution: ${{ env.JAVA_DISTRO }} | |
| cache: 'maven' | |
| server-id: central # Value of the distributionManagement/repository/id field of the pom.xml | |
| server-username: MAVEN_USERNAME # env variable for username in deploy | |
| server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | |
| # ------------------------- | |
| # Maven Deploy | |
| # ------------------------- | |
| - name: Deploy Maven Artifacts | |
| run: | | |
| mvn -B -e -Prelease -Pdeployment -Pgpg deploy | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USER }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| deploy-website: | |
| name: Website Deployment | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| actions: read | |
| contents: write | |
| steps: | |
| - name: Manage GH_TOKEN | |
| if: env.GH_TOKEN == '' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 | |
| with: | |
| token: ${{ env.GH_TOKEN }} | |
| submodules: recursive | |
| # ------------------------- | |
| # Java | |
| # ------------------------- | |
| - name: Set up Maven | |
| uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | |
| with: | |
| maven-version: ${{ env.MAVEN_VERSION }} | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e | |
| with: | |
| java-version-file: ${{ env.JAVA_VERSION_FILE }} | |
| distribution: ${{ env.JAVA_DISTRO }} | |
| cache: 'maven' | |
| # ------------------------- | |
| # Maven Site | |
| # ------------------------- | |
| - name: Build Website | |
| run: | | |
| mvn -B -e -Prelease package site site:stage | |
| - name: Run deploy script | |
| run: | | |
| touch target/staging/.nojekyll | |
| echo "oss-maven.metaschema.dev" > target/staging/CNAME | |
| bash .github/workflows/deploy.sh --push-only -v -m "Deploying website [ci skip]" |