Skip to content
Open
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
18 changes: 18 additions & 0 deletions .github/licenses_checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
permittedLicenses:
- MIT
- BSD-3-Clause
- MIT-Modern-Variant
- Zlib
- Apache-2.0
- BSD-2-Clause
- ISC
- MPL-2.0

approvedPackages:
no-file:
- flutter_localizations
- flutter_test
- flutter_web_plugins

rejectedLicenses:
- GPL
47 changes: 0 additions & 47 deletions .github/workflows/deploy_web.yml

This file was deleted.

55 changes: 28 additions & 27 deletions .github/workflows/flutter_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
name: Flutter CI
on:
push:
branches:
- main
workflow_dispatch:

pull_request:
branches:
- main
# pull_request:
# branches:
# - main

jobs:
flutter_ci:
name: Run flutter test and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v4
- name: Checkout repositoy
uses: actions/checkout@v5

- name: Install flutter
uses: subosito/flutter-action@v2

- name: Prepare repository
uses: Spaccesi/flutter-actions-suite/prepare@main
with:
distribution: "zulu"
java-version: "12"
- uses: subosito/flutter-action@v2
run-build-runner: "false"
run-gen-l10n: "true"
gen-l10n-fails-if-untranslated: "true"

- name: Check repository
uses: Spaccesi/flutter-actions-suite/check@main
with:
channel: "stable"
- run: flutter pub get
- run: flutter analyze
- run: flutter test
- name: Generate localizations
run: flutter gen-l10n
- name: Check for untranslated messages
run-license: "true"
compatible-licenses-conf-path: ".github/licenses_checker.yaml"

- name: Check license headers
continue-on-error: true
run: |
content=$(cat untranslated_messages.json)
if [ "$content" = "{}" ]; then
echo "✅ All translations are complete!"
exit 0
else
echo "❌ Found untranslated messages:"
cat untranslated_messages.json
echo ""
echo "Please add the missing translations to the corresponding .arb files"
MISSING_HEADERS=$(find lib test -name "*.dart" ! -name "*.g.dart" ! -name "*.freezed.dart" ! -name "*.mocks.dart" ! -name "app_localizations*.dart" -exec sh -c '! grep -q "^// Copyright (C) 2026 Víctor Carreras" "$1" && echo "$1"' _ {} \;)
if [ -n "$MISSING_HEADERS" ]; then
echo "❌ The following files are missing the GPL-3.0 license header:"
echo "$MISSING_HEADERS"
exit 1
else
echo "✅ All files have the correct GPL-3.0 license header."
fi
233 changes: 233 additions & 0 deletions .github/workflows/prod_deloy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
name: Flutter PROD deployment
on:
push:
# tags:
# - "v[0-9]+.[0-9]+.[0-9]+*"
branches:
- feature/github-actions-refactor
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
actions: write

jobs:
prepare_and_check:
name: Prepare and check repository
runs-on: ubuntu-latest
steps:
- name: Checkout repositoy
uses: actions/checkout@v5

- name: Install flutter
uses: subosito/flutter-action@v2

- name: Prepare repository
uses: Spaccesi/flutter-ci-suite/prepare@main
with:
run-build-runner: "false"
run-gen-l10n: "true"
gen-l10n-fails-if-untranslated: "true"

- name: Check repository
uses: Spaccesi/flutter-ci-suite/check@main
with:
run-license: "true"
compatible-licenses-conf-path: ".github/licenses_checker.yaml"

- name: Check license headers
continue-on-error: true
run: |
MISSING_HEADERS=$(find lib test -name "*.dart" ! -name "*.g.dart" ! -name "*.freezed.dart" ! -name "*.mocks.dart" ! -name "app_localizations*.dart" -exec sh -c '! grep -q "^// Copyright (C) 2026 Víctor Carreras" "$1" && echo "$1"' _ {} \;)
if [ -n "$MISSING_HEADERS" ]; then
echo "❌ The following files are missing the GPL-3.0 license header:"
echo "$MISSING_HEADERS"
exit 1
else
echo "✅ All files have the correct GPL-3.0 license header."
fi

- name: Upload prepared workspace
uses: actions/upload-artifact@v4
with:
name: prepared-repo
path: |
.
!.git
retention-days: 1

build_and_release_web:
name: Build and release web on GitHub Pages
runs-on: ubuntu-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build & Publish web
uses: Spaccesi/flutter-ci-suite@main
with:
base-href: "/${{ github.event.repository.name }}/"
run-test: "false"
run-build-runner: "false"
run-gen-l10n: "false"
run-analyze: "false"
run-license: "false"
build-platform: "web"
publish-destination: "github-pages"

build_and_release_ios:
name: Build and release ios on App Store
runs-on: macos-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build ios
uses: Spaccesi/flutter-ci-suite/build/ios@main
with:
ios-distribution-certificate-base64: ${{ secrets.IOS_DISTRIBUTION_CERTIFICATE_BASE64 }}
ios-distribution-certificate-password: ${{ secrets.IOS_DISTRIBUTION_CERTIFICATE_PASSWORD }}
ios-provisioning-profile-base64: ${{ secrets.IOS_PROVISIONING_PROFILE_BASE64 }}

- name: Publish ios
uses: Spaccesi/flutter-ci-suite/publish/ios-app-store@main
with:
apple-api-key-id: ${{ secrets.APPLE_API_KEY_ID }}
apple-api-key-issuer-id: ${{ secrets.APPLE_API_KEY_ISSUER }}
apple-api-key-content: ${{ secrets.APPLE_API_KEY_CONTENT }}

build_and_release_macos:
name: Build and release macos on App Store
runs-on: macos-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build macos
uses: Spaccesi/flutter-ci-suite/build/macos@main
with:
macos-installer-certificate-base64: ${{ secrets.MACOS_INSTALLER_CERTIFICATE_BASE64 }}
macos-installer-certificate-password: ${{ secrets.MACOS_INSTALLER_CERTIFICATE_PASSWORD }}
macos-distribution-certificate-base64: ${{ secrets.MACOS_DISTRIBUTION_CERTIFICATE_BASE64 }}
macos-distribution-certificate-password: ${{ secrets.MACOS_DISTISTRIBUTION_CERTIFICATE_PASSWORD }}
macos-provisioning-profile-base64: ${{ secrets.MACOS_PROVISIONING_PROFILE_BASE64 }}

- name: Publish macos
uses: Spaccesi/flutter-ci-suite/publish/macos-app-store@main
with:
apple-api-key-id: ${{ secrets.APPLE_API_KEY_ID }}
apple-api-key-issuer-id: ${{ secrets.APPLE_API_KEY_ISSUER }}
apple-api-key-content: ${{ secrets.APPLE_API_KEY_CONTENT }}

build_and_release_linux:
name: Build and release linux on Snap Store
runs-on: ubuntu-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build linux
uses: Spaccesi/flutter-ci-suite/build/linux@main

- name: Publish on snap
uses: Spaccesi/flutter-ci-suite/publish/snap-store@main
with:
snap-store-token: ${{ secrets.SNAPCRAFT_CREDENTIALS }}

build_and_release_android:
name: Build and release android on Google Play
runs-on: ubuntu-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build android
uses: Spaccesi/flutter-ci-suite/build/android@main
with:
android-store-file-base64: ${{ secrets.ANDROID_STORE_FILE_BASSE64 }}
android-key-password: ${{ secrets.ANDROID_KEY_PASSWORD }}
android-store-password: ${{ secrets.ANDROID_STORE_PASSWORD }}
android-key-alias: ${{ secrets.ANDROID_KEY_ALIAS }}

- name: Publish Android
uses: Spaccesi/flutter-ci-suite/publish/play-store@main
with:
android-service-account-json: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
android-package-name: es.victorcarreras.oraffle
android-track: production
android-release-files: build/app/outputs/bundle/release/app-release.aab

build_and_release_windows:
name: Build and deploy windows on Microsoft Store
runs-on: windows-latest
needs: [prepare_and_check]
steps:
- name: Download prepared workspace
uses: actions/download-artifact@v4
with:
name: prepared-repo

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build ios
uses: Spaccesi/flutter-ci-suite/build/windows@main

- name: Publish Microsoft store
uses: Spaccesi/flutter-ci-suite/publish/microsoft-store@main
with:
microsoft-partner-center-tenant-id: ${{ secrets.MICROSOFT_PARTNER_CENTER_TENANT_ID }}
microsoft-partner-center-seller-id: ${{ secrets.MICROSOFT_PARTNER_CENTER_SELLER_ID }}
microsoft-partner-center-client-id: ${{ secrets.MICROSOFT_PARTNER_CENTER_CLIENT_ID }}
microsoft-partner-center-client-secret: ${{ secrets.MICROSOFT_PARTNER_CENTER_CLIENT_SECRET }}

clean_up:
runs-on: ubuntu-latest
name: Clean up artifacts
needs:
[
prepare_and_check,
build_and_release_web,
build_and_release_windows,
build_and_release_android,
build_and_release_linux,
build_and_release_macos,
build_and_release_ios,
]
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v4
with:
name: prepared-repo
Loading
Loading