Skip to content

Commit 9739284

Browse files
committed
Modify release-workflow to test if publishing works
1 parent cf0b6ad commit 9739284

File tree

1 file changed

+35
-37
lines changed

1 file changed

+35
-37
lines changed
Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release RC and Update Docs
1+
name: Upload test
22

33
env:
44
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_TOKEN_USER }}
@@ -8,35 +8,51 @@ env:
88
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_ANDROID_SIGNING_PASSWORD }}
99

1010
on:
11+
workflow_call:
12+
inputs:
13+
rc_version:
14+
required: true
15+
type: string
1116
workflow_dispatch:
1217
inputs:
1318
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'
1520
required: true
1621

1722
permissions:
1823
contents: write
1924

2025
jobs:
21-
release-to-maven-central:
22-
runs-on: ubuntu-latest
26+
release:
2327
timeout-minutes: 60
28+
runs-on: ubuntu-latest
2429
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
3435
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
3653
uses: actions/checkout@v4
3754
with:
38-
ref: release/${{ inputs.rc_version }}
39-
fetch-depth: 0
55+
ref: test/${{ inputs.rc_version }}
4056

4157
- name: Setup Java
4258
uses: actions/setup-java@v4
@@ -47,24 +63,6 @@ jobs:
4763
- name: Setup Gradle
4864
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
4965

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

Comments
 (0)