-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (69 loc) · 2.66 KB
/
on-push-to-main-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: On push to main branch
on:
push:
branches: [main]
jobs:
generate-readme:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
- name: Generate README
uses: momentohq/standards-and-practices/github-actions/generate-and-commit-oss-readme@gh-actions-v2
with:
project_status: incubating
project_stability: alpha
project_type: sdk
sdk_language: Kotlin
dev_docs_slug: kotlin
release-please:
runs-on: ubuntu-latest
needs: [ generate-readme ]
outputs:
release_created: ${{ steps.release.outputs.release_created }}
name: Release Please
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: java
package-name: client-sdk-kotlin
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
extra-files: |
build.gradle.kts
publish:
runs-on: ubuntu-latest
needs: [ release-please ]
if: needs.release-please.outputs.release_created == 'true'
steps:
- name: Setup repo
uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'corretto'
# The Android SDK is required to build the project, even if we are not running Android tests.
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Build project
uses: gradle/[email protected]
with:
arguments: clean build -x jvmTest -x testDebugUnitTest -x testReleaseUnitTest
- name: Publish to sonatype
env:
SONATYPE_SIGNING_KEY: ${{ secrets.SONATYPE_SIGNING_KEY }}
SONATYPE_SIGNING_KEY_PASSWORD: ${{ secrets.SONATYPE_SIGNING_KEY_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_version: ${{ steps.semrel.outputs.version }}
uses: gradle/[email protected]
with:
# TODO: automatically release when release process is verified to work
# arguments: publishToSonatype closeAndReleaseStagingRepository
arguments: publishToSonatype closeSonatypeStagingRepository