-
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.
- Loading branch information
Showing
4 changed files
with
57 additions
and
26 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 |
---|---|---|
|
@@ -9,9 +9,6 @@ jobs: | |
|
||
runs-on: ubuntu-22.04 | ||
|
||
outputs: | ||
VCODE: ${{ steps.get_vcode.outputs.VCODE }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -21,29 +18,17 @@ jobs: | |
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | ||
|
||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Set version | ||
run: | | ||
sed -i 's/$version/${{ steps.get_version.outputs.VERSION }}/g' app/version.properties | ||
- name: Get VCODE | ||
id: get_vcode | ||
run: echo "VCODE=$(expr $(date +%s) / 60 - 26797800)" >> $GITHUB_OUTPUT | ||
|
||
- name: Build APK | ||
run: bash ./gradlew assembleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
run: bash ./gradlew assembleRelease --stacktrace -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
|
||
- name: Build AAB | ||
run: bash ./gradlew :app:bundleRelease --stacktrace -Dversion.code=${{ steps.get_vcode.outputs.VCODE }} -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
run: bash ./gradlew :app:bundleRelease --stacktrace -Dpurchase.validation.key=${{ secrets.PURCHASE_VALIDATION_KEY }} | ||
|
||
- name: Setup build tool version variable | ||
shell: bash | ||
|
@@ -120,11 +105,22 @@ jobs: | |
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 "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | ||
- name: Checkout release/next branch | ||
run: | | ||
git checkout release/next | ||
- name: Checkout master | ||
- name: Read version.properties | ||
id: read_version_properties | ||
run: | | ||
while IFS='=' read -r key value; do | ||
if [ "$key" ]; then | ||
echo "$key=$value" | ||
# Set as environment variable | ||
echo "$key=$value" >> $GITHUB_OUTPUT | ||
fi | ||
done < app/version.properties | ||
- name: Checkout master branch | ||
run: | | ||
git checkout master | ||
|
@@ -137,15 +133,15 @@ jobs: | |
- 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.outputs.VCODE}}.txt | ||
echo "${{ steps.get_release.outputs.body }}" | sed '/^-/!d;s/- #[[:digit:]]\+ \(.*\) @\(.*\)/- \1/g' | head -n 10 >> fastlane/metadata/android/en-US/changelogs/${{ steps.read_version_properties.outputs.VERSION_CODE }}.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.outputs.VCODE}}.txt | ||
git commit -m "Update release changelog for ${{ steps.get_version.outputs.VERSION }}" | ||
git add fastlane/metadata/android/en-US/changelogs/${{ steps.read_version_properties.outputs.VERSION_CODE }}.txt | ||
git commit -m "Update release changelog for ${{ steps.read_version_properties.outputs.VERSION_NAME }}" | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
|
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 |
---|---|---|
|
@@ -9,9 +9,43 @@ on: | |
jobs: | ||
update_release_draft: | ||
name: ✏️ Draft release | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: 🚀 Run Release Drafter | ||
id: release_drafter | ||
uses: release-drafter/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate VCODE | ||
id: generate_vcode | ||
run: echo "vcode=$(expr $(date +%s) / 60 - 26797800)" >> $GITHUB_OUTPUT | ||
|
||
- name: Set version | ||
run: | | ||
sed -i 's/$version/${{ steps.release_drafter.outputs.name }}/g' app/version.properties | ||
sed -i 's/$code/${{ steps.generate_vcode.outputs.vcode }}/g' app/version.properties | ||
- name: Commit version | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Configure release information | ||
branch: release/next | ||
create_branch: true | ||
push_options: '--force' | ||
|
||
- name: Change target | ||
run: | | ||
curl -X PATCH \ | ||
-H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | ||
-H 'Accept: application/vnd.github.v3+json' \ | ||
-H 'Content-Type: application/json' \ | ||
"https://api.github.com/repos/frimtec/pikett-assist/releases/${{ steps.release_drafter.outputs.id }}" \ | ||
-d '{"tag_name": "${{ steps.release_drafter.outputs.name }}", "target_commitish": "refs/heads/release/next"}' |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
VERSION_NAME=$version-Roboto | ||
VERSION_NAME=$version | ||
VERSION_CODE=$code |