release #27
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
| name: release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to release' | |
| required: true | |
| version: | |
| description: 'Release version' | |
| required: true | |
| nextVersion: | |
| description: 'Next version after release (-SNAPSHOT will be added automatically)' | |
| required: true | |
| deployMavenActive: | |
| description: 'Deploy Maven Active value for JReleaser (use NEVER if already pushed)' | |
| required: false | |
| default: 'ALWAYS' | |
| type: string | |
| deployNPMActive: | |
| description: 'Deploy NPM value for the CLI (use NEVER if already published)' | |
| required: false | |
| default: 'ALWAYS' | |
| type: string | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| contents: write | |
| deployments: write | |
| id-token: write # Required for OIDC and NPM Trusted Publisher support | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ssh-key: ${{ secrets.RELEASE_DEPLOY_KEY }} | |
| fetch-depth: 0 | |
| ref: ${{ github.event.inputs.branch }} | |
| - name: Set up JDK 25 for x64 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| architecture: x64 | |
| cache: maven | |
| - name: Set Node.js 22.x | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22.22.1 | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| cache-dependency-path: 'cli/package-lock.json' | |
| - name: Update npm to latest version # Ensure npm 11.5.1 or later for trusted publishing | |
| run: npm install -g npm@latest | |
| - name: Set release version for Java components | |
| run: mvn -B -q versions:set -DnewVersion=${{ github.event.inputs.version }} | |
| - name: Set release version for CLI | |
| run: | | |
| cd cli | |
| npm install | |
| npm version ${{ github.event.inputs.version }} --git-tag-version=false | |
| npm run build | |
| - name: Commit, push and tag changes | |
| run: | | |
| git config user.name "reshapr-bot" | |
| git config user.email "info@reshapr.io" | |
| git commit -m "Releasing version ${{ github.event.inputs.version }}" . | |
| git tag ${{ github.event.inputs.version }} | |
| git push origin ${{ github.event.inputs.version }} | |
| - name: Stage release artifacts | |
| run: mvn -B -Prelease clean deploy -DaltDeploymentRepository=local::default::file://`pwd`/target/staging-deploy | |
| - name: Publish package with NPM | |
| if: ${{ github.event.inputs.deployNPMActive == 'ALWAYS' }} | |
| run: | | |
| cd cli | |
| npm sbom --sbom-format spdx > reshapr-reshapr-cli-${{ github.event.inputs.version }}.spdx-sbom.json | |
| npm publish --provenance | |
| npm pack | |
| - name: Genenate NPM SBOM and package at least for GitHub release | |
| if: ${{ github.event.inputs.deployNPMActive != 'ALWAYS' }} | |
| run: | | |
| cd cli | |
| npm sbom --sbom-format spdx > reshapr-reshapr-cli-${{ github.event.inputs.version }}.spdx-sbom.json | |
| npm pack | |
| - name: Publish package with JReleaser | |
| env: | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JRELEASER_DEPLOY_MAVEN_ACTIVE: ${{ github.event.inputs.deployMavenActive }} | |
| run: mvn -N -Prelease jreleaser:assemble jreleaser:full-release | |
| # Persist logs | |
| - name: JReleaser release output | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: jreleaser-release | |
| path: | | |
| target/jreleaser/trace.log | |
| target/jreleaser/output.properties | |
| - name: Set next iteration version | |
| run: mvn -B -q versions:set -DnewVersion=${{ github.event.inputs.nextVersion }}-SNAPSHOT | |
| - name: Set next iteration version for CLI and Web UI | |
| run: | | |
| cd cli | |
| npm version ${{ github.event.inputs.nextVersion }}-SNAPSHOT --git-tag-version=false | |
| cd ../web-ui | |
| npm version ${{ github.event.inputs.nextVersion }}-SNAPSHOT --git-tag-version=false | |
| - name: Commit and push changes | |
| run: | | |
| git commit -m "Setting SNAPSHOT version ${{ github.event.inputs.nextVersion }}-SNAPSHOT" . | |
| git push origin ${{ github.event.inputs.branch }} |