Skip to content

Commit

Permalink
Adjust CD to use sonatype repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
StefMa committed Nov 27, 2023
1 parent bc07814 commit 7baa0c3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Publish Snapshots'

on:
push:
branches:
- 'main'

jobs:
publish-snapshots:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish to GitHub Packages
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

- name: Publish to Sonatype Snapshot
run: ./gradlew publishAllPublicationsToSonatypeSnapshotRepository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
50 changes: 10 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,28 @@
name: 'Publish'
name: 'Publish Maven Central Staging'

on:
push:
tags:
- '*'
branches:
- 'main'

env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}

jobs:
publish-kmp-metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish metadata
run: ./gradlew publishKotlinMultiplatformPublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

publish-jvm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish jvm
run: ./gradlew publishJvmPublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

publish-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish linux
run: ./gradlew publishLinuxX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

publish-darwin:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Publish darwin
run: ./gradlew publishMacosX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

publish-mingw:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Publish to GitHub Packages
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}

- name: Publish mingw
run: ./gradlew.bat publishMingwX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }}
- name: Publish to Sonatype Staging
run: ./gradlew publishAllPublicationsToSonatypeStagingRepository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}

0 comments on commit 7baa0c3

Please sign in to comment.