@@ -2,6 +2,11 @@ name: Build Release Packages
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ release_tag :
7+ description : Release tag to build, for example v1.1.13-beta
8+ required : false
9+ type : string
510 push :
611 tags :
712 - " v*"
4045 steps :
4146 - uses : actions/checkout@v4
4247
48+ - name : Sync build version from tag
49+ id : sync_version
50+ shell : bash
51+ env :
52+ RELEASE_TAG : ${{ github.event.inputs.release_tag || github.ref_name }}
53+ run : |
54+ if command -v python3 >/dev/null 2>&1; then
55+ python3 ./scripts/ci-sync-version.py
56+ else
57+ python ./scripts/ci-sync-version.py
58+ fi
59+
4360 - uses : dtolnay/rust-toolchain@stable
4461
4562 - name : Use crates.io in CI
8198 - name : Upload artifacts
8299 uses : actions/upload-artifact@v4
83100 with :
84- name : linuxdo-accelerator-${{ matrix.artifact_name }}
101+ name : linuxdo-accelerator-${{ steps.sync_version.outputs.package_version }}-${{ matrix.artifact_name }}
85102 path : |
86103 dist/**
87104 target/release/linuxdo-accelerator*
@@ -94,18 +111,28 @@ jobs:
94111 - abi : arm64-v8a
95112 rust_target : aarch64-linux-android
96113 artifact_name : android-arm64-v8a
97- apk_name : linuxdo-accelerator-android-arm64-v8a.apk
98114 - abi : x86_64
99115 rust_target : x86_64-linux-android
100116 artifact_name : android-x86_64
101- apk_name : linuxdo-accelerator-android-x86_64.apk
102117
103118 runs-on : ubuntu-latest
104119 name : Build ${{ matrix.artifact_name }}
105120
106121 steps :
107122 - uses : actions/checkout@v4
108123
124+ - name : Sync build version from tag
125+ id : sync_version
126+ shell : bash
127+ env :
128+ RELEASE_TAG : ${{ github.event.inputs.release_tag || github.ref_name }}
129+ run : |
130+ if command -v python3 >/dev/null 2>&1; then
131+ python3 ./scripts/ci-sync-version.py
132+ else
133+ python ./scripts/ci-sync-version.py
134+ fi
135+
109136 - uses : actions/setup-java@v4
110137 with :
111138 distribution : temurin
@@ -150,20 +177,20 @@ jobs:
150177 ANDROID_ABI : ${{ matrix.abi }}
151178 RUST_TARGET : ${{ matrix.rust_target }}
152179 ANDROID_BUILD_TYPE : release
153- APK_OUTPUT_NAME : ${{ matrix.apk_name }}
180+ APK_OUTPUT_NAME : linuxdo-accelerator- ${{ steps.sync_version.outputs.package_version }}-android-${{ matrix.abi }}.apk
154181 run : |
155182 export ANDROID_NDK_HOME="${ANDROID_SDK_ROOT}/ndk/27.2.12479018"
156183 ./scripts/build-android-apk.sh
157184
158185 - name : Upload Android artifacts
159186 uses : actions/upload-artifact@v4
160187 with :
161- name : linuxdo-accelerator-${{ matrix.artifact_name }}
188+ name : linuxdo-accelerator-${{ steps.sync_version.outputs.package_version }}-${{ matrix.artifact_name }}
162189 path : |
163190 android/dist/*.apk
164191
165192 publish-release :
166- if : startsWith(github.ref, 'refs/tags/v')
193+ if : startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.release_tag, 'v'))
167194 needs :
168195 - build
169196 - build-android
@@ -184,6 +211,7 @@ jobs:
184211 - name : Upload assets to GitHub Release
185212 uses : softprops/action-gh-release@v2
186213 with :
214+ tag_name : ${{ github.event.inputs.release_tag || github.ref_name }}
187215 files : |
188216 release-artifacts/**/dist/**
189217 release-artifacts/**/*.apk
0 commit comments