-
Notifications
You must be signed in to change notification settings - Fork 0
Add automatic snapshot publishing #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Publish Snapshot builds | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - develop | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: snapshot-release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| permissions: | ||
| contents: write | ||
| uses: ./.github/workflows/release.yml | ||
| with: | ||
| bump: patch | ||
gpunto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| snapshot: true | ||
| secrets: | ||
| github-token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }} | ||
| maven-central-username: ${{ secrets.OSSRH_USERNAME }} | ||
| maven-central-password: ${{ secrets.OSSRH_PASSWORD }} | ||
| signing-key: ${{ secrets.SIGNING_KEY }} | ||
| signing-key-id: ${{ secrets.SIGNING_KEY_ID }} | ||
| signing-key-password: ${{ secrets.SIGNING_PASSWORD }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,42 @@ on: | |
| required: true | ||
|
|
||
| jobs: | ||
| publish: | ||
| publish-snapshot: | ||
| if: ${{ inputs.snapshot }} | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.github-token }} | ||
| ref: develop | ||
|
|
||
| - name: Bump version | ||
| id: bump | ||
| uses: GetStream/stream-build-conventions-android/.github/actions/bump-version@develop | ||
| with: | ||
| bump: ${{ inputs.bump }} | ||
| file: ${{ inputs.version-properties-file }} | ||
gpunto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Setup Gradle | ||
| uses: GetStream/stream-build-conventions-android/.github/actions/setup-gradle@develop | ||
| with: | ||
| cache-read-only: false | ||
|
|
||
| - name: Build and publish snapshot | ||
| run: ./gradlew publish --no-configuration-cache | ||
| env: | ||
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.maven-central-username }} | ||
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.maven-central-password }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.signing-key }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signing-key-id }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signing-key-password }} | ||
| ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: true | ||
| SNAPSHOT: true | ||
|
|
||
| publish-release: | ||
| if: ${{ !inputs.snapshot }} | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
|
|
@@ -85,15 +120,14 @@ jobs: | |
| push: false | ||
|
|
||
| - name: Push changes to ci-release branch | ||
| if: ${{ !inputs.snapshot }} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took the opportunity to completely split snapshot and final release publishing. I think it's less error prone this way, as we now have two separate jobs instead of one job with excluded steps. I also considered splitting the workflow into two files, but discarded that approach because I find it clearer to see the publishing in one place, so you don't have to know that two workflows exist. |
||
| run: git push origin HEAD:ci-release --force-with-lease | ||
|
|
||
| - name: Setup Gradle | ||
| uses: GetStream/stream-build-conventions-android/.github/actions/setup-gradle@develop | ||
| with: | ||
| cache-read-only: false | ||
|
|
||
| - name: Build and publish | ||
| - name: Build and publish release | ||
| run: ./gradlew publish --no-configuration-cache | ||
| env: | ||
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.maven-central-username }} | ||
|
|
@@ -102,11 +136,9 @@ jobs: | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.signing-key-id }} | ||
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.signing-key-password }} | ||
| ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: true | ||
| # todo Make it a gradle property instead? | ||
| SNAPSHOT: ${{ inputs.snapshot }} | ||
| SNAPSHOT: false | ||
|
|
||
| - name: Create Github Release | ||
| if: ${{ !inputs.snapshot }} | ||
| uses: ncipollo/[email protected] | ||
| with: | ||
| generateReleaseNotes: true | ||
|
|
@@ -117,7 +149,7 @@ jobs: | |
|
|
||
| sync_branches: | ||
| if: ${{ !inputs.snapshot }} | ||
| needs: publish | ||
| needs: publish-release | ||
| name: Sync main and develop with release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just rely on the defaults (also, the idea is to align all SDKs to use the same mechanisms, so nobody will have to specify the version properties file).