diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a625e93 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release + +on: + workflow_dispatch: + inputs: + tag: + type: string + description: tag + +jobs: + bump_version: + name: "Bump Version" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Bump version + id: bump + run: "./mvnw versions:set -DnewVersion=${{ github.event.inputs.tag }} -DprocessAllModules && ./mvnw versions:commit -DprocessAllModules" + - name: Commit bumped version + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Prepare release version ${{ github.event.inputs.tag }}" + publish: + name: "Publish" + needs: [bump_version] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: main + - name: Set up Java + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + - name: Stage Release + run: ./mvnw -Prelease deploy -DaltDeploymentRepository=local::file:./target/staging-deploy + - name: Release + env: + JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} + JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_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 }} + run: ./mvnw -Prelease jreleaser:full-release --non-recursive diff --git a/pom.xml b/pom.xml index 50032f2..4af5f03 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,50 @@ - + + org.jreleaser + jreleaser-maven-plugin + false + + + + Bob - Builder generator + + https://github.com/jonasgeiregat/bob + + APACHE-2.0 + Jonas Geiregat + 2024 Jonas Geiregat + + + + + ALWAYS + conventional-commits + + + + + ALWAYS + true + + + + + + ALWAYS + https://s01.oss.sonatype.org/service/local + https://s01.oss.sonatype.org/content/repositories/snapshots/ + true + true + target/staging-deploy + + + + + + +