From 9cc266a2ad62182ec7fb36600908765fb2fa434b Mon Sep 17 00:00:00 2001 From: Ben Manes Date: Mon, 22 Feb 2021 17:08:21 -0800 Subject: [PATCH] Split the release workflow out from the build action --- .github/workflows/build.yml | 11 +---------- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cbc12141e8..cdaa12b6e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: build -on: [ push, pull_request, release ] +on: [ push, pull_request ] env: ORG_GRADLE_PROJECT_checksumFailOn: build_finish @@ -63,12 +63,3 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: ./gradlew publishToSonatype - - name: Releasing - if: > - matrix.java == env.MIN_JVM - && github.event_name == 'release' - && github.event.action == 'created' - env: - NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Prelease diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..1ed450e791 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: release +on: + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache Gradle packages + uses: actions/cache@v2.1.4 + with: + path: | + ~/.gradle/wrapper + ~/.gradle/caches + ~/.sonar/cache + key: ${{ runner.os }}-${{ github.job }}-${{ matrix.java }}-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Releasing + env: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_signingKeyId: 20BCF6B1 + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Prelease