|
1 | | -name: Release RC and Update Docs |
| 1 | +name: Upload test |
2 | 2 |
|
3 | 3 | env: |
4 | 4 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_TOKEN_USER }} |
|
8 | 8 | ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_ANDROID_SIGNING_PASSWORD }} |
9 | 9 |
|
10 | 10 | on: |
| 11 | + workflow_call: |
| 12 | + inputs: |
| 13 | + rc_version: |
| 14 | + required: true |
| 15 | + type: string |
11 | 16 | workflow_dispatch: |
12 | 17 | inputs: |
13 | 18 | rc_version: |
14 | | - description: 'SDK version this workflow run will release. Specify <major.minor.patch> e.g. 7.1.2. It will use the branch "release/<version>".' |
| 19 | + description: 'Version to create new RC for. Specify <major.minor.patch>, e.g. 7.1.2' |
15 | 20 | required: true |
16 | 21 |
|
17 | 22 | permissions: |
18 | 23 | contents: write |
19 | 24 |
|
20 | 25 | jobs: |
21 | | - release-to-maven-central: |
22 | | - runs-on: ubuntu-latest |
| 26 | + release: |
23 | 27 | timeout-minutes: 60 |
| 28 | + runs-on: ubuntu-latest |
24 | 29 | steps: |
25 | | - - name: Validate access to version data service |
26 | | - uses: embrace-io/public-actions/upload-sdk-version@88167cd1a3fce3418e26c8c842026e6dfab99e41 |
27 | | - with: |
28 | | - platform: 'android' |
29 | | - version: ${{ inputs.rc_version }} |
30 | | - dryRun: true |
31 | | - uploadUrl: ${{ vars.SDK_VERSION_URL }} |
32 | | - env: |
33 | | - SDK_VERSION_TOKEN: ${{ secrets.SDK_VERSION_TOKEN }} |
| 30 | + - name: Decode Keystore |
| 31 | + run: | |
| 32 | + mkdir "$RUNNER_TEMP"/keystore |
| 33 | + echo $mavenSigningKeyRingFileEncoded | base64 -di > "$RUNNER_TEMP"/keystore/2DE631C1.gpg |
| 34 | + echo "mavenSigningKeyRingFile=$RUNNER_TEMP/keystore/2DE631C1.gpg" >> $GITHUB_ENV |
34 | 35 |
|
35 | | - - name: Checkout SDK |
| 36 | + - name: Configure git |
| 37 | + run: | |
| 38 | + git config --global user.name 'embrace-ci[bot]' |
| 39 | + git config --global user.email 'embrace-ci@users.noreply.github.com' |
| 40 | +
|
| 41 | + - name: Create Test Branch "test/${{ inputs.rc_version }}" |
| 42 | + run: | |
| 43 | + git checkout -b test/${{ inputs.rc_version }} |
| 44 | +
|
| 45 | + - name: Set version in gradle.properties |
| 46 | + run: | |
| 47 | + sed -i -r "s#version=([^\']+)#version=${{ inputs.rc_version }}#" gradle.properties |
| 48 | + git add gradle.properties |
| 49 | + git commit -m "CI/CD: change version to be released: ${{ inputs.rc_version }}" |
| 50 | + git push --set-upstream origin test/${{ inputs.rc_version }} |
| 51 | +
|
| 52 | + - name: Checkout |
36 | 53 | uses: actions/checkout@v4 |
37 | 54 | with: |
38 | | - ref: release/${{ inputs.rc_version }} |
39 | | - fetch-depth: 0 |
| 55 | + ref: test/${{ inputs.rc_version }} |
40 | 56 |
|
41 | 57 | - name: Setup Java |
42 | 58 | uses: actions/setup-java@v4 |
|
47 | 63 | - name: Setup Gradle |
48 | 64 | uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1 |
49 | 65 |
|
50 | | -# Releases are done manually now, from the central portal. |
51 | | -# - name: Release from Staging Repository |
52 | | -# run: | |
53 | | -# ./gradlew releaseToMavenCentral --no-configuration-cache --stacktrace |
54 | | - |
55 | | - - name: Record SDK Version History |
56 | | - uses: embrace-io/public-actions/upload-sdk-version@88167cd1a3fce3418e26c8c842026e6dfab99e41 |
57 | | - with: |
58 | | - platform: 'android' |
59 | | - version: ${{ inputs.rc_version }} |
60 | | - dryRun: false |
61 | | - uploadUrl: ${{ vars.SDK_VERSION_URL }} |
62 | | - env: |
63 | | - SDK_VERSION_TOKEN: ${{ secrets.SDK_VERSION_TOKEN }} |
64 | | - |
65 | | - publish-api-docs: |
66 | | - name: Publish API Docs to GitHub Pages |
67 | | - uses: ./.github/workflows/publish-api-docs.yml |
68 | | - secrets: inherit |
69 | | - with: |
70 | | - rc_version: ${{ inputs.rc_version }} |
| 66 | + - name: Publish to Maven Central |
| 67 | + run: | |
| 68 | + ./gradlew publishToMavenCentral -x embrace-gradle-plugin-integration-tests:publishToMavenCentral --no-configuration-cache --stacktrace |
0 commit comments