Release #17
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: | |
| releaseType: | |
| description: "Release Type" | |
| required: true | |
| default: "patch" | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| timeout-minutes: 120 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "graalvm" | |
| java-version: "24" | |
| cache: "gradle" | |
| - name: Set Git Identity | |
| run: | | |
| git config --global user.email "mariano.gonzalez.mx@gmail.com" | |
| git config --global user.name "Mariano Gonzalez" | |
| - name: Setup GPG | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
| - name: Update Version and Create Tag | |
| id: version | |
| run: | | |
| # Create release with specified increment type | |
| ./gradlew release -Prelease.incrementer=${{ inputs.releaseType }} -Prelease.disableChecks -x test | |
| # Get the version number | |
| RAW_VERSION=$(./gradlew currentVersion -q -Prelease.quiet) | |
| # Use the actual tag name that was created (with 'v' prefix) | |
| TAG_VERSION="v$RAW_VERSION" | |
| echo "version=$RAW_VERSION" >> $GITHUB_OUTPUT | |
| echo "tagName=$TAG_VERSION" >> $GITHUB_OUTPUT | |
| - name: Build project | |
| run: | | |
| ./gradlew clean build publish -x test | |
| env: | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tagName }} | |
| name: Release ${{ steps.version.outputs.version }} | |
| generate_release_notes: true | |
| files: | | |
| build/staging-deploy/io/github/eschizoid/mcp-github-code-analyzer/${{ steps.version.outputs.version }}/**/* | |
| - name: Publish to Maven Central | |
| env: | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| run: | | |
| ./gradlew jreleaserFullRelease --stacktrace |