Skip to content

Commit 4bdc43d

Browse files
committed
ci: move versionCode bump to build
1 parent 83c0ff4 commit 4bdc43d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/build.yml

+9
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ jobs:
104104
if: ${{ inputs.build_type == 'debug' }}
105105
run: ./gradlew :app:assembleFdroidDebug --stacktrace
106106

107+
# bump versionCode for nightly and prerelease builds
108+
- name: Commit and push versionCode changes
109+
if: ${{ inputs.build_type == 'nightly' || inputs.build_type == 'prerelease' }}
110+
run: |
111+
git config --global user.name 'GitHub Actions'
112+
git config --global user.email 'actions@github.com'
113+
git add versionCode.txt
114+
git commit -m "Automated build update"
115+
107116
- name: Get release apk path
108117
id: apk-path
109118
run: echo "path=$(find . -regex '^.*/build/outputs/apk/fdroid/${{ inputs.build_type }}/.*\.apk$' -type f | head -1 | tail -c+2)" >> $GITHUB_OUTPUT

.github/workflows/publish.yml

-8
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,6 @@ jobs:
114114
version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $5}' | tr -d '\n')
115115
echo "VERSION_CODE=$version_code" >> $GITHUB_ENV
116116
117-
- name: Commit and push versionCode changes
118-
if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' }}
119-
run: |
120-
git config --global user.name 'GitHub Actions'
121-
git config --global user.email 'actions@github.com'
122-
git add versionCode.txt
123-
git commit -m "Automated build update"
124-
125117
- name: Push changes
126118
if: ${{ inputs.release_type == '' || inputs.release_type == 'nightly' || inputs.release_type == 'prerelease' }}
127119
uses: ad-m/github-push-action@master

0 commit comments

Comments
 (0)