-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate "fastlane changelog" and "google play whats new" from releas…
…e body (#322)
- Loading branch information
Showing
4 changed files
with
62 additions
and
14 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 |
---|---|---|
|
@@ -2,13 +2,16 @@ name: Deploy release | |
|
||
on: | ||
release: | ||
types: [created] | ||
types: [prereleased, released] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-18.04 | ||
|
||
outputs: | ||
VCODE: ${{ steps.get_vcode.outputs.VCODE }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
@@ -32,15 +35,15 @@ jobs: | |
run: | | ||
sed -i 's/$version/${{ steps.get_version.outputs.VERSION }}/g' app/version.properties | ||
- name: Get VCODE_TIME | ||
id: get_vcode_time | ||
run: echo ::set-output name=VCODE_TIME::$(date +%s) | ||
- name: Get VCODE | ||
id: get_vcode | ||
run: echo ::set-output name=VCODE::$(expr $(date +%s) / 60 - 26797800) | ||
|
||
- name: Build APK | ||
run: bash ./gradlew assembleRelease --stacktrace -Dversion.code.time=${{ steps.get_vcode_time.outputs.VCODE_TIME }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
run: bash ./gradlew assembleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
|
||
- name: Build AAB | ||
run: bash ./gradlew :app:bundleRelease --stacktrace -Dversion.code.time=${{ steps.get_vcode_time.outputs.VCODE_TIME }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
run: bash ./gradlew :app:bundleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
|
||
- uses: r0adkll/sign-android-release@v1 | ||
name: Sign app APK | ||
|
@@ -81,6 +84,13 @@ jobs: | |
id: get_track | ||
run: echo ::set-output name=TRACK::$(if [[ "${{ steps.get_release.outputs.prerelease }}" == "false" ]] ; then echo production ; else echo alpha ; fi) | ||
|
||
- name: Generate whatsnew | ||
id: generate_whatsnew | ||
run: | | ||
mkdir -p google-play/whatsnew | ||
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' >> google-play/whatsnew/whatsnew-de-DE | ||
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' >> google-play/whatsnew/whatsnew-en-US | ||
- name: Upload AAB Google Play | ||
id: upload-release-asset-aab | ||
uses: r0adkll/[email protected] | ||
|
@@ -89,4 +99,48 @@ jobs: | |
packageName: com.github.frimtec.android.pikettassist | ||
releaseFiles: ${{steps.sign_app_aab.outputs.signedReleaseFile}} | ||
track: ${{ steps.get_track.outputs.TRACK }} | ||
whatsNewDirectory: google-play/whatsnew | ||
whatsNewDirectory: google-play/whatsnew | ||
|
||
update-repo: | ||
|
||
runs-on: ubuntu-latest | ||
needs: deploy | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | ||
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | ||
|
||
- name: Checkout master | ||
run: | | ||
git checkout master | ||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Create fastlane changelog | ||
run: | | ||
mkdir -p fastlane/metadata/android/en-US/changelogs | ||
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' | head -n 10 >> fastlane/metadata/android/en-US/changelogs/${{needs.deploy-apk.outputs.VCODE}}.txt | ||
- name: Commit changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add fastlane/metadata/android/en-US/changelogs/${{needs.deploy-apk.outputs.VCODE}}.txt | ||
git commit -m "Update release changelog for ${{ steps.get_version.outputs.VERSION }}" | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: 'master' |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.