Skip to content

Commit

Permalink
Upgrade project layout and upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Oct 31, 2024
1 parent 076102c commit 05f9cad
Show file tree
Hide file tree
Showing 892 changed files with 3,694 additions and 43,315 deletions.
130 changes: 59 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
name: Flutter build

on:
on:
push:
branches:
- "*"
tags:
- stable
- nightly
release:
release:
types: [published]
pull_request:
jobs:
build-apk:
concurrency: ci-${{ github.ref }}
defaults:
run:
working-directory: app
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v4
- name: 🔧 Setup java
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
distribution: "temurin"
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: 📦 Get dependencies
run: |
flutter clean
Expand All @@ -48,12 +44,12 @@ jobs:
if [[ -n "$KEY_JKS" ]] ; then echo "$KEY_JKS" | base64 --decode > key.jks ; fi
#- run: flutter test
- name: 🏭 Build nightly
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.prerelease) }}
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.release.prerelease) }}
run: |
flutter build apk -v --release --flavor nightly --dart-define=flavor=nightly
cp build/app/outputs/flutter-apk/app-nightly-release.apk linwood-flow-android.apk
- name: 🏭 Build production
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
run: |
flutter build apk -v --release --flavor production
cp build/app/outputs/flutter-apk/app-production-release.apk linwood-flow-android.apk
Expand All @@ -63,14 +59,14 @@ jobs:
name: apk-build
path: app/linwood-flow-android.apk
- name: 🏭 Build architecture nightly
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.prerelease) }}
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.release.prerelease) }}
run: |
flutter build apk -v --release --target-platform android-arm,android-arm64,android-x64 --split-per-abi --flavor nightly --dart-define=flavor=nightly
cp build/app/outputs/flutter-apk/app-armeabi-v7a-nightly-release.apk linwood-flow-android-arm.apk
cp build/app/outputs/flutter-apk/app-arm64-v8a-nightly-release.apk linwood-flow-android-arm64.apk
cp build/app/outputs/flutter-apk/app-x86_64-nightly-release.apk linwood-flow-android-x86_64.apk
- name: 🏭 Build architecture production
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
run: |
flutter build apk -v --release --target-platform android-arm,android-arm64,android-x64 --split-per-abi --flavor production
cp build/app/outputs/flutter-apk/app-armeabi-v7a-production-release.apk linwood-flow-android-arm.apk
Expand Down Expand Up @@ -99,15 +95,11 @@ jobs:
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v4
- name: Get flutter version
shell: bash
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- name: Make yq tool available on Windows runners
run: choco install yq
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: ✅ Enable platforms
run: flutter config --enable-windows-desktop
- name: 📦 Get dependencies
Expand All @@ -116,12 +108,12 @@ jobs:
flutter pub get
flutter doctor -v
- name: 🏭 Build nightly
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.prerelease) }}
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build windows -v --release --dart-define=flavor=nightly
- name: 🏭 Build production
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build windows -v --release --dart-define=flavor=production
Expand All @@ -148,7 +140,7 @@ jobs:
path: |
app/linwood-flow-windows-setup-x86_64.exe
build-linux:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
defaults:
run:
working-directory: app
Expand Down Expand Up @@ -179,14 +171,9 @@ jobs:
libsecret-1-dev \
libjsoncpp-dev \
rpm
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: ✅ Enable platforms
run: flutter config --enable-linux-desktop
- name: 📦 Get dependencies
Expand All @@ -195,12 +182,12 @@ jobs:
flutter pub get
flutter doctor -v
- name: 🏭 Build nightly
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.prerelease) }}
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build linux -v --release --dart-define=flavor=nightly
- name: 🏭 Build production
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build linux -v --release --dart-define=flavor=production
Expand Down Expand Up @@ -260,7 +247,7 @@ jobs:
app/linwood-flow-linux-x86_64.AppImage
build-flatpak:
name: build-flatpak
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
defaults:
run:
working-directory: app
Expand Down Expand Up @@ -290,14 +277,9 @@ jobs:
alien \
libsecret-1-dev \
libjsoncpp-dev
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: ✅ Enable platforms
run: flutter config --enable-linux-desktop
- name: 📦 Get dependencies
Expand All @@ -306,12 +288,12 @@ jobs:
flutter pub get
flutter doctor -v
- name: 🏭 Build nightly
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.prerelease) }}
if: ${{ github.ref != 'refs/tags/stable' && (github.event_name != 'release' || github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build linux -v --release --dart-define=flavor=nightly
- name: 🏭 Build production
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
run: |
flutter doctor -v
flutter build linux -v --release --dart-define=flavor=production
Expand Down Expand Up @@ -354,17 +336,12 @@ jobs:
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v4
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.12"
- name: ✅ Enable platforms
run: flutter config --enable-macos-desktop
- name: 📦 Get dependencies
Expand All @@ -381,9 +358,11 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "22"
- name: Install appdmg
run: npm install -g appdmg
run: |
python3 -m pip install setuptools
npm install -g appdmg
- name: Create dmg
run: |
appdmg DmgSetup.json linwood-flow-macos.dmg
Expand All @@ -409,14 +388,9 @@ jobs:
steps:
- name: ⬆️ Checkout
uses: actions/checkout@v4
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: 📦 Get dependencies
run: |
flutter clean
Expand All @@ -433,7 +407,7 @@ jobs:
cp -R Runner.app Payload/
rm -f linwood-flow-ios.ipa
zip -vr linwood-flow-ios.ipa Payload/
# ls -l linwood-flow-ios.ipa
# ls -l linwood-flow-ios.ipa
- name: Archive
uses: actions/upload-artifact@v4
with:
Expand All @@ -460,9 +434,9 @@ jobs:
# - uses: actions/upload-artifact@v4
# with:
# name: flow-snap
# path: ${{ steps.build.outputs.snap }}
# path: ${{ steps.build.outputs.snap }}
deploy:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request'
outputs:
version: ${{ steps.setup.outputs.FLOW_VERSION }}
Expand Down Expand Up @@ -551,8 +525,25 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Actions"
git pull --tags
- name: Add checksums
run: |
output_file="checksums.txt"
# Empty the output file if it exists
> "$output_file"
# Find and loop through all files starting with "linwood-flow" in the current directory
for file in linwood-flow*; do
# Check if the file exists (in case no matches were found)
if [ -f "$file" ]; then
# Append sha256sum to the output file in the format "hash filename"
sha256sum "$file" >> "$output_file"
fi
done
echo "SHA256 hashes for files starting with 'linwood-flow' saved to $output_file"
- name: 🚀 Deploy stable
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.release.prerelease) }}
uses: softprops/action-gh-release@v2
continue-on-error: true
with:
Expand All @@ -570,6 +561,7 @@ jobs:
linwood-flow-macos.dmg
linwood-flow-android.apk
linwood-flow-ios.ipa
checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 🚀 Deploy nightly
Expand All @@ -594,6 +586,7 @@ jobs:
linwood-flow-android-arm64.apk
linwood-flow-android-x86_64.apk
linwood-flow-ios.ipa
checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
Expand All @@ -619,8 +612,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy-to-play-store:
runs-on: ubuntu-22.04
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-24.04
if: ${{ startsWith(github.ref, 'refs/tags/') }}
defaults:
run:
working-directory: app
Expand Down Expand Up @@ -650,22 +643,17 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "adopt"
- name: Get flutter version
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
distribution: "temurin"
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
flutter-version-file: app/pubspec.yaml
- name: 📦 Get dependencies
run: |
flutter pub get
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3.0"
ruby-version: "3.3.5"
bundler-cache: true
working-directory: app/android
- name: 🚀 Deploy to Play Store
Expand All @@ -687,7 +675,7 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
- if: ${{ github.ref == 'refs/tags/stable' || (github.event_name == 'release' && !github.event.prerelease) }}
- if: ${{ github.ref == 'refs/tags/stable' }}
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: LinwoodDev.Flow
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/compress-images.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Compress images on demand (workflow_dispatch), and at 11pm every Sunday (schedule).
# Open a Pull Request if any images can be compressed.
name: Compress Images
permissions:
contents: write
pull-requests: write
on:
workflow_dispatch:
schedule:
- cron: '00 23 * * 0'
- cron: "00 23 * * 0"
jobs:
build:
name: calibreapp/image-actions
Expand All @@ -29,4 +26,3 @@ jobs:
branch-suffix: timestamp
commit-message: Compressed Images
body: ${{ steps.calibre.outputs.markdown }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 05f9cad

Please sign in to comment.