Skip to content

Commit

Permalink
Split the release workflow out from the build action
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Feb 23, 2021
1 parent 70b3a51 commit 9cc266a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
on: [ push, pull_request, release ]
on: [ push, pull_request ]

env:
ORG_GRADLE_PROJECT_checksumFailOn: build_finish
Expand Down Expand Up @@ -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
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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

0 comments on commit 9cc266a

Please sign in to comment.