-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: release management implemented (#242)
- Loading branch information
1 parent
743e678
commit 1edc7e1
Showing
4 changed files
with
91 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Release Workflow | ||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run on New Release | ||
run: | | ||
echo "A new release was created." | ||
echo "Release name: ${{ github.event.release.name }}" | ||
echo "Release tag: ${{ github.event.release.tag_name }}" | ||
- name: Validating Release | ||
run: | | ||
pattern="^v[0-9]+(\.[0-9]+)+$" | ||
if [[ ${{ github.event.release.name }} =~ $pattern ]]; then | ||
echo "${{ github.event.release.name }} is valid" | ||
else | ||
echo "${{ github.event.release.name }} is not valid" | ||
exit 1 | ||
fi | ||
- name: Extract Version details | ||
run: | | ||
releaseName="${{ github.event.release.name }}" | ||
echo "release name: $releaseName" | ||
versionName=${releaseName:1} | ||
echo "version name: $versionName" | ||
IFS='.' read -ra versionStubs <<< "$versionName" | ||
echo "versionMajor : ${versionStubs[0]}" | ||
echo "versionMinor : ${versionStubs[1]}" | ||
echo "versionPatch : ${versionStubs[2]}" | ||
echo "versionMajor=${versionStubs[0]}" >> $GITHUB_ENV | ||
echo "versionMinor=${versionStubs[1]}" >> $GITHUB_ENV | ||
echo "versionPatch=${versionStubs[2]}" >> $GITHUB_ENV | ||
- name: Commit version.properties changes | ||
run: | | ||
git fetch --all | ||
git checkout develop | ||
echo "major=${{ env.versionMajor }}" > version.properties | ||
echo "minor=${{ env.versionMinor }}" >> version.properties | ||
echo "patch=${{ env.versionPatch }}" >> version.properties | ||
echo "channel=release" >> version.properties | ||
echo "build=0" >> version.properties | ||
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git config --local user.name "${GITHUB_ACTOR}" | ||
git add version.properties | ||
commitTitle="ci(release): version bump ${{ env.versionMajor }}.${{ env.versionMinor }}.${{ env.versionPatch }}" | ||
commitBody="see release details https://github.com/androidPluto/pluto/releases/tag/${{ github.event.release.tag_name }}" | ||
git commit -m "$commitTitle" -m "$commitBody" | ||
- name: Publish artifacts to MavenCentral | ||
# run: ./gradlew publish | ||
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | ||
|
||
- name: Pushing changes to version.properties post deployment | ||
run: | | ||
git fetch --all | ||
git checkout develop | ||
git push | ||
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
.externalNativeBuild | ||
.cxx | ||
/.idea/* | ||
/scripts/publish/publish.properties |
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