forked from jonjomckay/fritter
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: build_kitkat | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_kitkat_release: | ||
if: ${{github.ref_type == 'branch' && github.ref_name == 'kitkat'}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install and set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
|
||
- name: Install and set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.16.9' | ||
channel: 'stable' | ||
|
||
- name: Set up signing key | ||
run: echo $SIGNING_KEY | base64 -d > android/app/key.jks | ||
env: | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
|
||
- name: Set env | ||
run: | | ||
APP_VERSION=$(git describe --tags --abbrev=0 | sed 's/v//g') | ||
echo "APPLICATION_VERSION=$APP_VERSION-kitkat" >> $GITHUB_ENV | ||
APP_BUILD_BASE=300000000 | ||
COMMIT_NUMBER=$(git rev-list HEAD --count) | ||
APP_BUILD_NUMBER=$((COMMIT_NUMBER*10+APP_BUILD_BASE)) | ||
echo "APPLICATION_BUILD_NUMBER=$APP_BUILD_NUMBER" >> $GITHUB_ENV | ||
- name: Build APKs | ||
run: | | ||
flutter config --no-analytics | ||
flutter pub get | ||
flutter pub run flutter_oss_licenses:generate.dart | ||
flutter pub run intl_utils:generate | ||
# Create a directory for our release APKs | ||
mkdir -pv build/app/outputs/release | ||
# Build our big boy APK, and move it into the release APKs folder | ||
flutter build apk --dart-define=app.flavor=github --release --no-tree-shake-icons --build-name=${{env.APPLICATION_VERSION}} --build-number=${{env.APPLICATION_BUILD_NUMBER}} | ||
mv build/app/outputs/apk/release/*.apk build/app/outputs/release | ||
# Build our ABI-specific APKs and move them into the release APKs folder | ||
flutter build apk --dart-define=app.flavor=github --release --no-tree-shake-icons --split-per-abi --target-platform=android-x64,android-arm,android-arm64 --build-name=${{env.APPLICATION_VERSION}} --build-number=${{env.APPLICATION_BUILD_NUMBER}} | ||
mv build/app/outputs/apk/release/*.apk build/app/outputs/release | ||
# *** Optional when an alternate F-Droid repository is also used *** | ||
# Build our ABI-specific APKs to copy them remotely to the alternate F-Droid repository. | ||
if [[ -n "$ALT_FDROID_REPO_USER" && -n "$ALT_FDROID_REPO_HOST" && -n "$ALT_FDROID_REPO_FOLDER" ]]; then | ||
flutter build apk --dart-define=app.flavor=fdroid --release --no-tree-shake-icons --split-per-abi --target-platform=android-x64,android-arm,android-arm64 --build-name=${{env.APPLICATION_VERSION}} --build-number=${{env.APPLICATION_BUILD_NUMBER}} | ||
sshpass -e scp build/app/outputs/apk/release/*.apk $ALT_FDROID_REPO_USER@$ALT_FDROID_REPO_HOST:$ALT_FDROID_REPO_FOLDER | ||
rm build/app/outputs/apk/release/*.apk | ||
fi | ||
env: | ||
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | ||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | ||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
KEY_PATH: key.jks | ||
# *** Optional when an alternate F-Droid repository is also used *** | ||
ALT_FDROID_REPO_USER: ${{ secrets.ALT_FDROID_REPO_USER }} | ||
ALT_FDROID_REPO_HOST: ${{ secrets.ALT_FDROID_REPO_HOST }} | ||
ALT_FDROID_REPO_FOLDER: ${{ secrets.ALT_FDROID_REPO_FOLDER }} | ||
SSHPASS: ${{ secrets.ALT_FDROID_REPO_PASSWORD }} | ||
|
||
- name: Upload APKs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kitkat_apks | ||
path: build/app/outputs/release/*.apk | ||
|