From 68133d375502c4010297c41b4eb39b43503146ad Mon Sep 17 00:00:00 2001 From: Jack Matthews <6348088+jackmatt2@users.noreply.github.com> Date: Sat, 29 Oct 2022 19:34:58 +1100 Subject: [PATCH] #none: Revert to manual release trigger --- .github/workflows/release.yml | 45 +++++++++++++++--------- .github/workflows/tag_and_release.yml | 50 --------------------------- 2 files changed, 28 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/tag_and_release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 300e09f..91958ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,26 +1,21 @@ -# This workflow will build a Java project with Gradle -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - name: release on: workflow_dispatch: - inputs: - release_version: - description: 'Release Version' - required: true - default: '3.X.X' - close_and_release: - description: 'Close & Release Staging Repository' - required: true - default: 'true' jobs: release: - name: Release to Maven Central + name: Release to Maven Central, Tag & Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Generate tag version + uses: anothrNick/github-tag-action@v1 + id: tag_version_dry_run + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: false + DRY_RUN: true - name: Set up JDK 8 uses: actions/setup-java@v1 with: @@ -29,7 +24,7 @@ jobs: run: chmod +x gradlew - name: Jar env: - RELEASE_VERSION: ${{ github.event.inputs.release_version }} + RELEASE_VERSION: ${{ steps.tag_version_dry_run.outputs.tag }} run: ./gradlew shadowJar -Pversion=$RELEASE_VERSION - name: Publish to Maven Central env: @@ -37,11 +32,27 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} MAVEN_CENTRAL_TOKEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} - RELEASE_VERSION: ${{ github.event.inputs.release_version }} + RELEASE_VERSION: ${{ steps.tag_version_dry_run.outputs.tag }} run: ./gradlew -Pversion=$RELEASE_VERSION signArchives uploadArchives -PossrhUsername=${MAVEN_CENTRAL_TOKEN_USERNAME} -PossrhPassword=${MAVEN_CENTRAL_TOKEN_PASSWORD} -Psign=true - name: Close & Release Staging Repository - if: github.event.inputs.close_and_release == 'true' env: MAVEN_CENTRAL_TOKEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} - run: ./gradlew closeAndReleaseRepository -PossrhUsername=${MAVEN_CENTRAL_TOKEN_USERNAME} -PossrhPassword=${MAVEN_CENTRAL_TOKEN_PASSWORD} \ No newline at end of file + run: ./gradlew closeAndReleaseRepository -PossrhUsername=${MAVEN_CENTRAL_TOKEN_USERNAME} -PossrhPassword=${MAVEN_CENTRAL_TOKEN_PASSWORD} + - name: Push new tag + uses: anothrNick/github-tag-action@v1 + id: tag_version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: false + DRY_RUN: false + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Github Release + uses: softprops/action-gh-release@v1 + with: + body: ${{steps.github_release.outputs.changelog}} + tag_name: ${{ steps.tag_version.outputs.tag }} \ No newline at end of file diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml deleted file mode 100644 index 47d9055..0000000 --- a/.github/workflows/tag_and_release.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: tag_and_release -on: - push: - branches: - - master -jobs: - release: - name: Release to Maven Central - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Bump version and push tag - uses: anothrNick/github-tag-action@v1 - id: tag_version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: false - - name: Set up JDK 8 - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Jar - env: - RELEASE_VERSION: ${{ steps.tag_version.outputs.tag }} - run: ./gradlew shadowJar -Pversion=$RELEASE_VERSION - - name: Publish to Maven Central - env: - ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY_ASCII_ARMOR }} - ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} - MAVEN_CENTRAL_TOKEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} - MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} - RELEASE_VERSION: ${{ steps.tag_version.outputs.tag }} - run: ./gradlew -Pversion=$RELEASE_VERSION signArchives uploadArchives -PossrhUsername=${MAVEN_CENTRAL_TOKEN_USERNAME} -PossrhPassword=${MAVEN_CENTRAL_TOKEN_PASSWORD} -Psign=true - - name: Close & Release Staging Repository - env: - MAVEN_CENTRAL_TOKEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} - MAVEN_CENTRAL_TOKEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} - run: ./gradlew closeAndReleaseRepository -PossrhUsername=${MAVEN_CENTRAL_TOKEN_USERNAME} -PossrhPassword=${MAVEN_CENTRAL_TOKEN_PASSWORD} - - name: Build Changelog - id: github_release - uses: mikepenz/release-changelog-builder-action@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Create Github Release - uses: softprops/action-gh-release@v1 - with: - body: ${{steps.github_release.outputs.changelog}} - tag_name: ${{ steps.tag_version.outputs.tag }} \ No newline at end of file