diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 911bf88d156..83095c60cf3 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -21,7 +21,7 @@ jobs: permissions: contents: read pull-requests: read - uses: GetStream/stream-build-conventions-android/.github/workflows/android-ci.yml@9ea4d20d64f99a1a05dd8c8f56504e5e2aa39ed7 + uses: GetStream/stream-build-conventions-android/.github/workflows/android-ci.yml@d275481d345e4b3b1252006dbb6cf029c9e32767 secrets: BUILD_CACHE_AWS_REGION: ${{ secrets.BUILD_CACHE_AWS_REGION }} BUILD_CACHE_AWS_BUCKET: ${{ secrets.BUILD_CACHE_AWS_BUCKET }} diff --git a/.github/workflows/pr-clean-old-drafts.yaml b/.github/workflows/pr-clean-old-drafts.yaml index e42c8767ed0..2e80ae34d11 100644 --- a/.github/workflows/pr-clean-old-drafts.yaml +++ b/.github/workflows/pr-clean-old-drafts.yaml @@ -12,5 +12,5 @@ permissions: jobs: pr-clean-stale: - uses: GetStream/stream-build-conventions-android/.github/workflows/pr-clean-stale.yaml@v0.14.1 + uses: GetStream/stream-build-conventions-android/.github/workflows/pr-clean-stale.yaml@v1.0.1 secrets: inherit diff --git a/.github/workflows/pr-quality.yml b/.github/workflows/pr-quality.yml index bb49acec5c2..cc932b8997e 100644 --- a/.github/workflows/pr-quality.yml +++ b/.github/workflows/pr-quality.yml @@ -14,5 +14,5 @@ concurrency: jobs: pr-checklist: - uses: GetStream/stream-build-conventions-android/.github/workflows/pr-quality.yml@v0.14.1 + uses: GetStream/stream-build-conventions-android/.github/workflows/pr-quality.yml@v1.0.1 secrets: inherit diff --git a/.github/workflows/publish-new-version.yml b/.github/workflows/publish-new-version.yml index 262d55a5400..0f6a056c2fe 100644 --- a/.github/workflows/publish-new-version.yml +++ b/.github/workflows/publish-new-version.yml @@ -12,6 +12,22 @@ on: - minor - major default: minor + suffix: + description: 'Optional version suffix (e.g. beta, rc01). A dash is added automatically.' + required: false + type: string + default: '' + publish-targets: + description: >- + Leave as-is. central is a manual escape hatch for a release that has to + go out when the Stream repository cannot take it. + required: false + type: choice + options: + - streamRepo + - streamRepo,central + - central + default: streamRepo concurrency: group: release @@ -32,9 +48,11 @@ jobs: permissions: contents: write needs: pre_release_check - uses: GetStream/stream-build-conventions-android/.github/workflows/release.yml@9ea4d20d64f99a1a05dd8c8f56504e5e2aa39ed7 + uses: GetStream/stream-build-conventions-android/.github/workflows/release.yml@d275481d345e4b3b1252006dbb6cf029c9e32767 with: bump: ${{ inputs.bump }} + suffix: ${{ inputs.suffix }} + publish-targets: ${{ inputs.publish-targets }} secrets: github-token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} maven-central-username: ${{ secrets.OSSRH_USERNAME }} @@ -43,3 +61,57 @@ jobs: signing-key-id: ${{ secrets.SIGNING_KEY_ID }} signing-key-password: ${{ secrets.SIGNING_PASSWORD }} slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_ANDROID_CICD }} + stream-repo-endpoint: ${{ secrets.STREAM_REPO_ENDPOINT }} + stream-repo-bucket: ${{ secrets.STREAM_REPO_BUCKET }} + stream-repo-access-key-id: ${{ secrets.STREAM_REPO_ACCESS_KEY_ID }} + stream-repo-secret-access-key: ${{ secrets.STREAM_REPO_SECRET_ACCESS_KEY }} + + # Customers need one line of setup to see a version that is not on Central, + # so say so at the top of the release, above the generated "What's Changed". + # A separate job because the release is created inside the reusable workflow. + release-notes-header: + needs: publish + if: ${{ inputs.publish-targets == 'streamRepo' }} + name: Add the Stream repository card to the release + runs-on: ubuntu-24.04 + permissions: + contents: write + steps: + - name: Prepend the card + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + # The release this run created: the reusable workflow targets it at the + # release-- branch, and it was published after this run started. + # "Newest release" alone could be one made by hand, or one from another branch. + STARTED=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" -q .created_at) + TAG=$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=30" -q " + [.[] | select((.target_commitish | startswith(\"release-${GITHUB_REF_NAME}-\")) + and .published_at != null and .published_at >= \"$STARTED\")] + | first | .tag_name // empty") + if [ -z "$TAG" ]; then + echo "::error::No release from this run found for ${GITHUB_REF_NAME}" + exit 1 + fi + + cat > card.md < [!IMPORTANT] + > **\`$TAG\` is published to the Stream Maven repository, not Maven Central.** + > + > \`\`\`kotlin + > // settings.gradle.kts + > dependencyResolutionManagement { + > repositories { + > google() + > mavenCentral() + > maven("https://stream-io-repo.com") + > } + > } + > \`\`\` + + EOF + + gh release view "$TAG" -R "$GITHUB_REPOSITORY" --json body -q .body > notes.md + cat card.md notes.md > body.md + gh release edit "$TAG" -R "$GITHUB_REPOSITORY" --notes-file body.md diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 05fb053c07a..3f056e24ae1 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -13,10 +13,11 @@ jobs: release: permissions: contents: write - uses: GetStream/stream-build-conventions-android/.github/workflows/release.yml@v0.14.1 + uses: GetStream/stream-build-conventions-android/.github/workflows/release.yml@v1.0.1 with: bump: patch snapshot: true + publish-targets: streamRepo secrets: github-token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} maven-central-username: ${{ secrets.OSSRH_USERNAME }} @@ -25,3 +26,7 @@ jobs: signing-key-id: ${{ secrets.SIGNING_KEY_ID }} signing-key-password: ${{ secrets.SIGNING_PASSWORD }} slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_ANDROID_CICD }} + stream-repo-endpoint: ${{ secrets.STREAM_REPO_ENDPOINT }} + stream-repo-bucket: ${{ secrets.STREAM_REPO_BUCKET }} + stream-repo-access-key-id: ${{ secrets.STREAM_REPO_ACCESS_KEY_ID }} + stream-repo-secret-access-key: ${{ secrets.STREAM_REPO_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/sdk-size-checks.yml b/.github/workflows/sdk-size-checks.yml index cee1a770cc9..c9e115410b6 100644 --- a/.github/workflows/sdk-size-checks.yml +++ b/.github/workflows/sdk-size-checks.yml @@ -13,7 +13,7 @@ concurrency: jobs: compare-sdk-sizes: - uses: GetStream/stream-build-conventions-android/.github/workflows/sdk-size-checks.yml@v0.14.1 + uses: GetStream/stream-build-conventions-android/.github/workflows/sdk-size-checks.yml@v1.0.1 with: modules: "stream-video-android-core stream-video-android-ui-xml stream-video-android-ui-compose" metrics-project: "stream-video-android-metrics" diff --git a/.github/workflows/sdk-size-updates.yml b/.github/workflows/sdk-size-updates.yml index c0b148a1010..cfc6f97dc8a 100644 --- a/.github/workflows/sdk-size-updates.yml +++ b/.github/workflows/sdk-size-updates.yml @@ -15,7 +15,7 @@ jobs: update-sdk-sizes: permissions: contents: read - uses: GetStream/stream-build-conventions-android/.github/workflows/sdk-size-updates.yml@9ea4d20d64f99a1a05dd8c8f56504e5e2aa39ed7 + uses: GetStream/stream-build-conventions-android/.github/workflows/sdk-size-updates.yml@d275481d345e4b3b1252006dbb6cf029c9e32767 with: modules: "stream-video-android-core stream-video-android-ui-xml stream-video-android-ui-compose" metrics-project: "stream-video-android-metrics" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 01a51be1fa0..1dba8cfd9b1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ allureKotlin = "2.4.0" androidGradlePlugin = "8.9.1" cameraCamera2 = "1.3.4" spotless = "6.21.0" -streamConventions = "0.14.1" +streamConventions = "1.0.1" kotlin = "1.9.25" ksp = "1.9.25-1.0.20" kotlinSerialization = "1.6.3" diff --git a/settings.gradle.kts b/settings.gradle.kts index 138ee763252..15b1d05c1a6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,6 +9,7 @@ pluginManagement { google() mavenCentral() mavenLocal() + maven("https://stream-io-repo.com") } } dependencyResolutionManagement { @@ -17,6 +18,7 @@ dependencyResolutionManagement { google() mavenCentral() maven(url = "https://plugins.gradle.org/m2/") + maven("https://stream-io-repo.com") } }