Release #19
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: | |
| version: | |
| description: 'Release version' | |
| required: true | |
| default: '0.1.0' | |
| next_version: | |
| description: 'Next development version' | |
| required: true | |
| default: '0.1.1-SNAPSHOT' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Update version | |
| run: | | |
| sed -i "s/version = \".*\"/version = \"${{ github.event.inputs.version }}\"/g" build.gradle.kts | |
| sed -i "s/:[0-9]\+\.[0-9]\+\.[0-9]\+/:${{ github.event.inputs.version }}/g" README.md | |
| sed -i "s/<version>[0-9]\+\.[0-9]\+\.[0-9]\+<\/version>/<version>${{ github.event.inputs.version }}<\/version>/g" README.md | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "GitHub Actions" | |
| if [[ -n $(git status --porcelain) ]]; then | |
| git commit -am "Release version ${{ github.event.inputs.version }}" | |
| git push origin main | |
| fi | |
| - name: Build and test | |
| run: ./gradlew build | |
| - name: Publish to Local Maven Staging | |
| run: ./gradlew publish --stacktrace --info | |
| - name: Release | |
| env: | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_GPG_PASSPHRASE }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_GPG_PRIVATE_KEY }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_GPG_PUBLIC_KEY }} | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_PASSWORD }} | |
| run: ./gradlew jreleaserRelease --stacktrace --info | |
| - name: Update to next development version | |
| run: | | |
| sed -i "s/version = \".*\"/version = \"${{ github.event.inputs.next_version }}\"/g" build.gradle.kts | |
| git commit -am "Prepare for next development version ${{ github.event.inputs.next_version }}" | |
| git push origin main |