Build and Release APKs #50
This file contains hidden or 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
name: Build and Release APKs | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to create release for (e.g., v1.0.0)' | |
required: true | |
default: 'v1.0.0' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
# flutter-version: '3.32.8' | |
channel: 'stable' | |
- name: Create keystore properties file | |
run: | | |
echo storePassword=${{ secrets.KEY_STORE_PASSWORD }} > android/key.properties | |
echo keyPassword=${{ secrets.KEY_PASSWORD }} >> android/key.properties | |
echo keyAlias=${{ secrets.KEY_ALIAS }} >> android/key.properties | |
echo storeFile=../keystore.jks >> android/key.properties | |
shell: bash | |
- name: Decode Keystore | |
run: | | |
echo "${{ secrets.KEY_STORE }}" | certutil -decode - > keystore.jks | |
shell: cmd | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Build universal APK | |
run: flutter build apk --release | |
- name: Build split APKs | |
run: flutter build apk --split-per-abi --release | |
- name: Rename APKs | |
run: | | |
mkdir -p release | |
copy build\app\outputs\flutter-apk\app-release.apk release\proxycloud-universal.apk | |
copy build\app\outputs\flutter-apk\app-armeabi-v7a-release.apk release\proxycloud-armeabi-v7a.apk | |
copy build\app\outputs\flutter-apk\app-arm64-v8a-release.apk release\proxycloud-arm64-v8a.apk | |
copy build\app\outputs\flutter-apk\app-x86_64-release.apk release\proxycloud-x86_64.apk | |
shell: cmd | |
- name: Get tag name | |
id: get_tag | |
run: | | |
if [[ $GITHUB_EVENT_NAME == 'workflow_dispatch' ]]; then | |
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | |
else | |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Create Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.TAG_NAME }} | |
name: Release ${{ env.TAG_NAME }} | |
draft: false | |
prerelease: false | |
files: | | |
release/proxycloud-universal.apk | |
release/proxycloud-armeabi-v7a.apk | |
release/proxycloud-arm64-v8a.apk | |
release/proxycloud-x86_64.apk | |
body: | | |
## Installation | |
### Download | |
| Architecture | Download Link | | |
|-------------|---------------| | |
| Universal | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-universal.apk"><img src="https://img.shields.io/badge/Android-Universal-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android Universal"></a> | | |
| armeabi-v7a | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-armeabi-v7a.apk"><img src="https://img.shields.io/badge/Android-armeabi--v7a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android armeabi-v7a"></a> | | |
| arm64-v8a | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-arm64-v8a.apk"><img src="https://img.shields.io/badge/Android-arm64--v8a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android arm64-v8a"></a> | | |
| x86_64 | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-x86_64.apk"><img src="https://img.shields.io/badge/Android-x86_64-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android x86_64"></a> | |