diff --git a/.github/workflows/publish-snapshots.yml b/.github/workflows/publish-snapshots.yml new file mode 100644 index 0000000..a03cb17 --- /dev/null +++ b/.github/workflows/publish-snapshots.yml @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b22fd73..f5d28f3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,11 +1,9 @@ -name: 'Publish' +name: 'Publish Maven Central Staging' on: push: tags: - '*' - branches: - - 'main' env: GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} @@ -13,46 +11,18 @@ env: 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 }}