Skip to content

Commit

Permalink
Fix publishing workflow (#212)
Browse files Browse the repository at this point in the history
Jobs run in parallel, so the publishing one never got any build output or even code. With this change there's just one `publish` job that checks out, builds and publishes.
  • Loading branch information
jacobras committed Feb 28, 2024
1 parent c8d0a02 commit a00f5fa
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,18 @@ on:
types: [ released ]

jobs:
build:
name: Build - Publish
publish:
runs-on: macos-latest

steps:
- name: Check out code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}

# Builds the debug artifacts of the library
- name: Build - Publish
run: ./gradlew build

publish:
needs: [ build ]
runs-on: macos-latest
steps:
# Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
Expand Down

0 comments on commit a00f5fa

Please sign in to comment.