From 08c3999cc0fc8f7d5d5f4aee0f50a55372fedf7d Mon Sep 17 00:00:00 2001 From: Rahul Behera Date: Sat, 6 Jan 2024 23:47:29 -0800 Subject: [PATCH] lets see if this works at all --- .github/workflows/merged.yaml | 61 +++++++++++++++++++++++++++++------ gradle.properties | 2 +- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/.github/workflows/merged.yaml b/.github/workflows/merged.yaml index 1f043e4..60f1c0e 100644 --- a/.github/workflows/merged.yaml +++ b/.github/workflows/merged.yaml @@ -1,13 +1,36 @@ name: "Build Test and Deploy" on: - push: - branches: [ main ] + pull_request: + paths-ignore: + - '*.md' + types: + - synchronize + - opened jobs: - deploy: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ macos-latest ] + create-staging-repository: + name: Create staging repository + runs-on: ubuntu-latest + outputs: + repository_id: ${{ steps.create.outputs.repository_id }} + steps: + - id: create + uses: nexus-actions/create-nexus-staging-repo@v1.3.0 + with: + username: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }} + base_url: https://oss.sonatype.org/service/local/staging/deploy/maven2/ + description: Created by $GITHUB_WORKFLOW ($GITHUB_ACTION) for $GITHUB_REPOSITORY + macos: + needs: create-staging-repository + runs-on: macOS-latest + env: + SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + GPG_SECRET: ${{ secrets.GPG_SECRET }} + GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} + NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} steps: - uses: actions/checkout@v3 - name: Set up JDK 19 @@ -33,8 +56,28 @@ jobs: GPG_SECRET: ${{ secrets.GPG_SECRET }} GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }} NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} - run: ./gradlew publishAllPublicationsToSonatypeRepository publish closeAndReleaseRepository + run: ./gradlew publishAllPublicationsToSonatypeRepository - uses: actions/upload-artifact@v3 with: name: Package - path: build/libs \ No newline at end of file + path: build/libs + finalize: + runs-on: ubuntu-latest + needs: [create-staging-repository, macos] + if: ${{ always() && needs.create_staging_repository.result == 'success' }} + steps: + - name: Discard + if: ${{ needs.macos.result != 'success' }} + uses: nexus-actions/drop-nexus-staging-repo@1.1.0 + with: + username: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + staging_repository_id: ${{ needs.create_staging_repository.outputs.repository-id }} + - name: Release + if: ${{ needs.macos.result == 'success' }} + uses: nexus-actions/release-nexus-staging-repo@1.3.0 + with: + username: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }} + close_only: true \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 163453d..90e3229 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official android.useAndroidX=true org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m kotlin.mpp.stability.nowarn=true -libraryVersionPrefix=1.3. +libraryVersionPrefix=0.0. libraryName=Buffer libraryDescription=Multiplatform bytebuffer that delegates to native byte[] or ByteBuffer publishedGroupId=com.ditchoom