Skip to content

Commit

Permalink
Consolidate release workflows (#1050)
Browse files Browse the repository at this point in the history
## Goal

Remove duplication and deprecated commands in pre-release and releases workflows. This that were removed include:

- Step to store signing key in a file
- GitHub auth over HTTPS - token already passed in
- Android signing/publishing credentials in `pre-release-workflow`

After this change, patches can be generated using `build-rc-workflow` with the right patch parameter. The default of 0 will be passed in if the normal `pre-release-workflow` is run.
  • Loading branch information
bidetofevil authored Jul 10, 2024
1 parent b075f14 commit 56cb3b4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 138 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/build-rc-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pre-Release - Create New Release Candidates
name: Pre-Release - Create New Release Candidate

env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
Expand All @@ -20,6 +20,10 @@ on:
version_of_rc:
description: 'Version to create new RC for. Specify <major.minor> only, e.g. 6.3'
required: true
patch_number:
description: 'Patch number. e.g. for 6.3.1, use "1". Defaults to 0'
default: '0'
required: true

jobs:
release:
Expand All @@ -30,17 +34,10 @@ jobs:
jdk-version: [ "17" ]
ndk-version: [ "21.4.7075529" ]
steps:
- name: Decode Keystore
run: |
mkdir "$RUNNER_TEMP"/keystore
echo $mavenSigningKeyRingFileEncoded | base64 -di > "$RUNNER_TEMP"/keystore/2DE631C1.gpg
echo "mavenSigningKeyRingFile=$RUNNER_TEMP/keystore/2DE631C1.gpg" >> $GITHUB_ENV
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
Expand Down Expand Up @@ -88,8 +85,8 @@ jobs:

- name: Set version tag in SDK
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.0
git tag -f ${{ github.event.inputs.version_of_rc }}.0
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags
- name: Checkout Swazzler
Expand All @@ -105,8 +102,8 @@ jobs:
- name: Set version tag in Swazzler
run: |
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.0
git tag -f ${{ github.event.inputs.version_of_rc }}.0
git push origin :refs/tags/${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git tag -f ${{ github.event.inputs.version_of_rc }}.${{ github.event.inputs.patch_number }}
git push origin --tags
- name: Cleanup Gradle Cache
Expand Down
113 changes: 0 additions & 113 deletions .github/workflows/pre-patch-workflow.yml

This file was deleted.

11 changes: 1 addition & 10 deletions .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
name: Pre-Release - Cut Release Branch and Publish Release Candidate

env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_TOKEN_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_TOKEN_USER_PASSWORD }}
MAVEN_QA_USER: github
MAVEN_QA_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
mavenSigningKeyId: ${{ secrets.MAVEN_ANDROID_SIGNING_KEY }}
mavenSigningKeyRingFileEncoded: ${{ secrets.MAVEN_ANDROID_GPG_KEY }}
mavenSigningKeyPassword: ${{ secrets.MAVEN_ANDROID_SIGNING_PASSWORD }}

on:
workflow_dispatch:
inputs:
Expand All @@ -28,7 +19,7 @@ jobs:
version_to_release: ${{ github.event.inputs.version_to_release }}
next_version: ${{ github.event.inputs.next_version }}

release-candate:
release-candidate:
name: Create Release Candidate
needs: release-branch
uses: ./.github/workflows/build-rc-workflow.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rc-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/rc-update-test-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout App
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Publish gh-pages
run: |
Expand Down

0 comments on commit 56cb3b4

Please sign in to comment.