-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change release GH actions to create and release from release branch (#…
…326) ## Goal Create a release branch to make any version-specific modifications on and make the release from there. The version number of the SDK will incremented when the release branch is cut, and commits after that will be de facto in the next release. The Swazzler will be updated in the pre-release workflow as it does before. If there are additional changes that need to go into the release branch, they can be done first in master, then cherrypicked into the release branch. For hotfixes, the same cherrypicking process will be done, but we will need to add additional GH Actions to ensure to automate the release.
- Loading branch information
1 parent
223b8fb
commit d24effb
Showing
2 changed files
with
30 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,13 @@ env: | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
next_version: | ||
description: 'Next Version (Do NOT include -SNAPSHOT, will be added automatically)' | ||
version_to_release: | ||
description: 'SDK version this workflow run will release. Specify <major.minor> only, without the patch number, e.g. `6.3`. It will use the branch `release/<version>`.' | ||
required: true | ||
patch_version_of_release: | ||
description: 'The patch version for this release, i.e. the third number per semantic versioning <major.minor.patch>. If it is not a hotfix, use the default of 0' | ||
required: true | ||
default: '0' | ||
|
||
jobs: | ||
release: | ||
|
@@ -28,6 +32,7 @@ jobs: | |
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: release/${{ github.event.inputs.version_to_release }} | ||
fetch-depth: 0 | ||
token: ${{ secrets.CD_GITHUB_TOKEN }} | ||
|
||
|
@@ -56,24 +61,16 @@ jobs: | |
mv .docs-newly-generated docs | ||
date > docs/version.txt | ||
echo ${{ github.sha }} >> docs/version.txt | ||
echo ${{ github.event.release.tag_name }} >> docs/version.txt | ||
echo ${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }} >> docs/version.txt | ||
git add -f docs | ||
git config --global user.name "embrace-ci" | ||
git config --global user.email "[email protected]" | ||
git commit --allow-empty --message 'CI/CD: Automatically generated documentation for ${{ github.event.release.tag_name }}' docs/ | ||
git commit --allow-empty --message 'CI/CD: Automatically generated documentation for ${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }}' docs/ | ||
git push --force origin gh-pages | ||
- name: Record SDK Version History (${{ github.event.inputs.current_version }}) | ||
run: | | ||
curl -X POST ${{ vars.SDK_VERSION_URL }}/android/version/ -H 'X-Embrace-CI: ${{ secrets.SDK_VERSION_TOKEN }}' -H 'Content-Type: application/json' -d '{"version": "${{ github.event.inputs.current_version }}"}' | ||
- name: Set next SDK version | ||
- name: Record SDK Version History (${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }}) | ||
run: | | ||
git checkout master | ||
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}-SNAPSHOT#" gradle.properties | ||
git add gradle.properties | ||
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}" | ||
git push | ||
curl -X POST ${{ vars.SDK_VERSION_URL }}/android/version/ -H 'X-Embrace-CI: ${{ secrets.SDK_VERSION_TOKEN }}' -H 'Content-Type: application/json' -d '{"version": "${{ github.event.inputs.version_to_release }}.${{ github.event.inputs.patch_version_of_release }}"}' | ||
- name: Cleanup Gradle Cache | ||
# Based on https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle#caching-dependencies | ||
|