Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
⚙️ GitHub Action | Update Increment Version Code Logic
Browse files Browse the repository at this point in the history
  • Loading branch information
moondev03 authored Aug 6, 2024
1 parent 8b7d12d commit 9a7bc53
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/versioning-and-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
git checkout -b version-update
git commit -am "[GitHub Action] Increment versionCode to $NEW_VERSION_CODE"
git add ./Nabi/presentation/build.gradle.kts
git commit -m "[GitHub Action] Increment versionCode to $NEW_VERSION_CODE"
echo "changed=true" >> $GITHUB_ENV
else
echo "changed=false" >> $GITHUB_ENV
Expand All @@ -57,25 +58,31 @@ jobs:
merge_version_update:
runs-on: ubuntu-latest
needs: increment_version_code
if: needs.increment_version_code.outputs.changed == 'true'
if: env.changed == 'true'

steps:
- name: Checkout code
- name: Checkout develop branch
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0

- name: Show current branch
- name: Configure Git
run: |
echo "Current branch:"
git branch
echo "Fetching remote branches"
git fetch origin
git config user.name "${{ secrets.GIT_USER_NAME }}"
git config user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: Merge version-update branch
run: |
git fetch origin
git checkout develop
git merge origin/version-update
echo "Pushing changes to develop branch"
git push origin develop
git merge origin/version-update --no-edit
- name: Push changes to develop branch
uses: ad-m/github-push-action@master
with:
branch: develop
github_token: ${{ secrets.HUBGIT_TOKEN }}

build_and_upload:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9a7bc53

Please sign in to comment.