From bc0640ab95eccd1b4f12f1591492f66d55f60329 Mon Sep 17 00:00:00 2001 From: Sargun Vohra Date: Sat, 23 Nov 2024 19:36:37 -0500 Subject: [PATCH] iterate publishing config --- .github/workflows/ci.yml | 17 +++++++++++++---- .github/workflows/release.yml | 9 ++++++--- README.md | 2 +- lib/build.gradle.kts | 6 +++--- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7322152e..d8c7d023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - format: + check-format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: - uses: ./.github/actions/setup - run: ./gradlew iosSimulatorArm64Test - artifact-docs: + build-docs: runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -53,7 +53,7 @@ jobs: with: path: build/dokka/htmlMultiModule - artifact-android-demo-app: + build-android-app: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -73,8 +73,17 @@ jobs: if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} runs-on: macos-latest permissions: - actions: write + packages: write steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - run: ./gradlew publishAllPublicationsToGitHubPackagesRepository + env: + ORG_GRADLE_PROJECT_githubToken: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_githubUser: ${{ github.actor }} + + all-good: + needs: [check-format, lint-android, test-android, test-ios, build-docs, build-android-app] + runs-on: ubuntu-latest + steps: + - run: echo "All checks passed!" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9d535f36..2399a422 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,11 @@ on: workflow_dispatch: jobs: - maven: + publish-maven: runs-on: macos-latest + environment: + name: maven + url: https://central.sonatype.com/artifact/dev.sargunv/maplibre-compose steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup @@ -33,8 +36,8 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ steps.import-gpg.outputs.key_id }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }} - pages: - needs: [maven] + publish-pages: + needs: [publish-maven] runs-on: macos-latest permissions: pages: write diff --git a/README.md b/README.md index c2079319..07bf5fa6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ In your Gradle version catalog, add: ```toml [libraries] # ... -maplibre-compose = { module = "dev.sargunv:maplibre-compose", version = "(TODO)" } +maplibre-compose = { module = "dev.sargunv.maplibre-compose:maplibre-compose", version = "(TODO)" } ``` In your Gradle build script, add: diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index 2f170219..07c7f43d 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -4,7 +4,7 @@ plugins { id("maven-publish") } subprojects { apply(plugin = "maven-publish") - group = "dev.sargunv" + group = "dev.sargunv.maplibre-compose" publishing { repositories { @@ -12,8 +12,8 @@ subprojects { name = "GitHubPackages" setUrl("https://maven.pkg.github.com/sargunv/maplibre-compose") credentials { - username = project.properties["GITHUB_USERNAME"]?.toString() - password = project.properties["GITHUB_TOKEN"]?.toString() + username = project.properties["githubUser"]?.toString() + password = project.properties["githubToken"]?.toString() } } }