Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
build/
.fvm/
.stamps/
.git/
ios/
.dart_tool/
.idea/
.vscode/
.DS_Store
*.keystore
.env
build_keys.conf
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.41.4"
}
25 changes: 25 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Docker Image
on:
push:
branches: [main]
paths: [Dockerfile, .fvmrc, .dockerignore]
permissions:
packages: write
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/foggedlens/deflock-builder:latest
cache-from: type=gha
cache-to: type=gha,mode=max
60 changes: 11 additions & 49 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'
setup: true
cache: true

- run: flutter pub get

- name: Analyze
run: flutter analyze

- name: Test
run: flutter test
- run: make ci

build-debug-apk:
name: Build Debug APK
Expand All @@ -38,31 +32,14 @@ jobs:
distribution: 'temurin'
java-version: '17'

- uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'
setup: true
cache: true

- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-

- run: flutter pub get

- name: Generate icons and splash screens
run: |
dart run flutter_launcher_icons
dart run flutter_native_splash:create
- run: make build-apk-debug

- name: Build debug APK
run: flutter build apk --debug

- name: Upload debug APK
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: debug-apk
path: build/app/outputs/flutter-apk/app-debug.apk
Expand All @@ -76,32 +53,17 @@ jobs:
steps:
- uses: actions/checkout@v5

- uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'
setup: true
cache: true

- uses: actions/cache@v4
with:
path: ios/Pods
key: pods-${{ runner.os }}-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: pods-${{ runner.os }}-

- run: flutter pub get

- name: Generate icons and splash screens
run: |
dart run flutter_launcher_icons
dart run flutter_native_splash:create

- name: Build iOS simulator app
run: flutter build ios --debug --simulator
- run: make build-ios-simulator

- name: Zip Runner.app
run: cd build/ios/iphonesimulator && zip -r "$GITHUB_WORKSPACE/Runner.app.zip" Runner.app

- name: Upload simulator build
uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4
with:
name: ios-simulator
path: Runner.app.zip
Expand Down
78 changes: 25 additions & 53 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
id: set-info
run: |
echo "is_prerelease=${{ github.event.release.prerelease }}" >> $GITHUB_OUTPUT

if [ "${{ github.event.release.prerelease }}" = "true" ]; then
echo "should_upload_to_stores=false" >> $GITHUB_OUTPUT
echo "✅ Pre-release - will build and attach assets, no store uploads"
Expand All @@ -44,27 +44,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up JDK 17
uses: actions/setup-java@v5
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'

- name: Install dependencies
run: flutter pub get
setup: true
cache: true

- name: Run tests
run: flutter test

- name: Generate icons and splash screens
run: |
dart run flutter_launcher_icons
dart run flutter_native_splash:create
run: make test

- name: Decode Keystore
run: |
Expand All @@ -78,7 +69,7 @@ jobs:
echo "storeFile=keystore.jks" >> android/key.properties

- name: Build Android .apk
run: flutter build apk --release --dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' --dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'
run: make release-apk FLUTTER_BUILD_ARGS="--dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' --dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'"

- name: Upload .apk artifact
uses: actions/upload-artifact@v4
Expand All @@ -96,27 +87,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up JDK 17
uses: actions/setup-java@v5
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'

- name: Set up Flutter
uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'

- name: Install dependencies
run: flutter pub get
setup: true
cache: true

- name: Run tests
run: flutter test

- name: Generate icons and splash screens
run: |
dart run flutter_launcher_icons
dart run flutter_native_splash:create
run: make test

- name: Decode Keystore
run: |
Expand All @@ -130,7 +112,7 @@ jobs:
echo "storeFile=keystore.jks" >> android/key.properties

- name: Build Android appBundle
run: flutter build appbundle --dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' --dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'
run: make release-aab FLUTTER_BUILD_ARGS="--dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' --dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'"

- name: Upload .aab artifact
uses: actions/upload-artifact@v4
Expand All @@ -147,21 +129,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v5

- name: Set up Flutter
uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v3
with:
channel: 'stable'

- name: Install dependencies
run: flutter pub get
setup: true
cache: true

- name: Run tests
run: flutter test

- name: Generate icons and splash screens
run: |
dart run flutter_launcher_icons
dart run flutter_native_splash:create
run: make test

- name: Install Apple certificate and provisioning profile
env:
Expand All @@ -187,15 +161,15 @@ jobs:
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# Set this keychain as the default
security list-keychain -d user -s $KEYCHAIN_PATH
security default-keychain -s $KEYCHAIN_PATH

# install provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/61f9fdb9-bf2d-4d94-b249-63155ee71e74.mobileprovision

# Also install using the profile's internal UUID for better compatibility
UUID=$(security cms -D -i $PP_PATH | plutil -extract UUID xml1 -o - - | xmllint --xpath "//string/text()" -)
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision
Expand Down Expand Up @@ -234,12 +208,10 @@ jobs:
EOF

- name: Build iOS .ipa
run: |
flutter build ipa --release \
--export-options-plist=ios/exportOptions.plist \
--dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' \
--dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'
cp build/ios/ipa/*.ipa Runner.ipa
run: make release-ios FLUTTER_BUILD_ARGS="--dart-define=OSM_PROD_CLIENTID='${{ secrets.OSM_PROD_CLIENTID }}' --dart-define=OSM_SANDBOX_CLIENTID='${{ secrets.OSM_SANDBOX_CLIENTID }}'"

- name: Copy IPA
run: cp build/ios/ipa/*.ipa Runner.ipa

- name: Clean up keychain and provisioning profile
run: |
Expand Down Expand Up @@ -323,14 +295,14 @@ jobs:
# Create the private keys directory and decode API key
mkdir -p ~/private_keys
echo -n "$APP_STORE_CONNECT_API_KEY_BASE64" | base64 --decode > ~/private_keys/AuthKey_${APP_STORE_CONNECT_API_KEY_ID}.p8

# Upload to App Store Connect / TestFlight
xcrun altool --upload-app \
--type ios \
--file Runner.ipa \
--apiKey $APP_STORE_CONNECT_API_KEY_ID \
--apiIssuer $APP_STORE_CONNECT_ISSUER_ID

# Clean up sensitive files
rm -rf ~/private_keys

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Thumbs.db
# Local OSM client ID configuration (contains secrets)
build_keys.conf

# Make stamp files (track build step completion)
.stamps/

# fvm local SDK symlink
.fvm/

# ───────────────────────────────
# For now - not targeting these
# ───────────────────────────────
Expand Down
Loading
Loading