Skip to content

Commit

Permalink
Merge pull request #17 from eyedol/main
Browse files Browse the repository at this point in the history
Publish all artifacts based on the supported build targets
  • Loading branch information
rharter authored Sep 16, 2024
2 parents 39d9317 + b712b9a commit 129e1c5
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,43 @@ jobs:
path: build-reports.zip

publish:
runs-on: ubuntu-latest
if: github.repository == 'dropbox/differ' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [build]
strategy:
matrix:
include:
- snapshot-target: publishIosArm64PublicationToMavenCentralRepository
os: macos-latest
- snapshot-target: publishJvmPublicationToMavenCentralRepository
os: ubuntu-latest
- snapshot-target: publishLinuxX64PublicationToMavenCentralRepository
os: ubuntu-latest
- release-target: publishIosArm64PublicationToMavenCentral
os: macos-latest
- release-target: publishJvmPublicationToMavenCentral
os: ubuntu-latest
- release-target: publishLinuxX64PublicationToMavenCentral
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.konan
key: ${{ runner.os }}-${{ hashFiles('**/.lock') }}

- name: Install JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- name: Upload Snapshot
run: ./gradlew :differ:publish
run: ./gradlew ${{ matrix.snapshot-target }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
Expand All @@ -78,7 +100,9 @@ jobs:
run: echo "VERSION_NAME=$(./gradlew -q printVersionName)" >> $GITHUB_ENV

- name: Publish release (main only)
run: ./gradlew closeAndReleaseRepository
run: |
./gradlew ${{ matrix.release-target }}
./gradlew closeAndReleaseRepository
if: success() && !endsWith(env.VERSION_NAME, '-SNAPSHOT')
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
Expand Down

0 comments on commit 129e1c5

Please sign in to comment.