Skip to content

Commit e780f32

Browse files
fix(ci): update release workflows to use dynamic versioning for APK and archives
1 parent b024d6b commit e780f32

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

.github/workflows/flutter-ci.android.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,22 @@ jobs:
9292
TAG_NAME=${GITHUB_REF#refs/tags/}
9393
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
9494
95+
- name: Get tag version
96+
run: |
97+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
98+
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
99+
100+
- name: Rename APK
101+
run: |
102+
mv android-build/app-release.apk android-build/whph-v${TAG_VERSION}-android.apk
103+
95104
# Create or update the release
96105
- name: Create or Update Release
97106
uses: softprops/action-gh-release@v1
98107
env:
99108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100109
with:
101-
files: android-build/app-release.apk
110+
files: android-build/whph-v${{ env.TAG_VERSION }}-android.apk
102111
name: Release ${{ env.TAG_NAME }}
103112
tag_name: ${{ env.TAG_NAME }}
104113
draft: false

.github/workflows/flutter-ci.linux.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ jobs:
7777
name: whph-v${{ env.APP_VERSION }}-linux
7878
path: linux-build
7979

80+
- name: Get tag version
81+
run: |
82+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
83+
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
84+
8085
- name: Create tar.gz archive
81-
run: tar -czf whph-v${{ env.APP_VERSION }}-linux.tar.gz -C linux-build .
86+
run: tar -czf whph-v${TAG_VERSION}-linux.tar.gz -C linux-build .
8287

8388
- name: Check existing release
8489
id: check_release
@@ -103,7 +108,7 @@ jobs:
103108
env:
104109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105110
with:
106-
files: whph-v${{ env.APP_VERSION }}-linux.tar.gz
111+
files: whph-v${{ env.TAG_VERSION }}-linux.tar.gz
107112
name: Release ${{ env.TAG_NAME }}
108113
tag_name: ${{ env.TAG_NAME }}
109114
draft: false

.github/workflows/flutter-ci.windows.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ jobs:
6767
TAG_NAME=${GITHUB_REF#refs/tags/}
6868
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
6969
70+
- name: Get tag version
71+
run: |
72+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
73+
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
74+
7075
- name: Download artifacts
7176
uses: actions/download-artifact@v4
7277
with:
@@ -75,7 +80,7 @@ jobs:
7580

7681
# Create a zip archive from the build output
7782
- name: Create zip archive
78-
run: cd windows-build && zip -r ../whph-v${{ env.APP_VERSION }}-windows.zip .
83+
run: cd windows-build && zip -r ../whph-v${TAG_VERSION}-windows.zip .
7984

8085
- name: Check existing release
8186
id: check_release
@@ -94,7 +99,7 @@ jobs:
9499
env:
95100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96101
with:
97-
files: whph-v${{ env.APP_VERSION }}-windows.zip
102+
files: whph-v${{ env.TAG_VERSION }}-windows.zip
98103
name: Release ${{ env.TAG_NAME }}
99104
tag_name: ${{ env.TAG_NAME }}
100105
draft: false

0 commit comments

Comments
 (0)