aggiunta build web e android
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
name: Build and Release FLUX Windows
|
||||
name: Build and Release FLUX (Multi-Platform)
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*' # Si attiva solo quando crei un tag tipo v1.0.0
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-native # Richiama esattamente l'etichetta del PC del collega
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 1: WINDOWS (Gira sul PC del collega appena si libera)
|
||||
# -----------------------------------------------------------------
|
||||
build-windows:
|
||||
runs-on: windows-native
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Flutter Definitiva
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
Set-Content -Path ".env" -Value "${{ secrets.ENV_FILE_CONTENT }}"
|
||||
|
||||
- name: Build Flutter Windows
|
||||
run: flutter build windows --release
|
||||
|
||||
- name: Compila Installer Inno Setup
|
||||
@@ -19,12 +26,65 @@ jobs:
|
||||
$TagVersion = "${{ gitea.ref_name }}".Substring(1)
|
||||
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=$TagVersion "win_installer.iss"
|
||||
|
||||
# Usa un'action standard per caricare il file su Gitea Releases
|
||||
- name: Upload Release Asset
|
||||
# Nel dubbio usiamo l'action per caricare l'asset
|
||||
- name: Upload Windows Asset
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: "build/windows/installer/FLUX_Setup_x64.exe"
|
||||
api_key: ${{ secrets.GITEA_TOKEN }}
|
||||
- name: Pulisci Workspace
|
||||
if: always() # Esegue questo step anche se la build fallisce
|
||||
|
||||
- name: Pulisci Workspace Windows
|
||||
if: always()
|
||||
run: Remove-Item -Recurse -Force ./*
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 2: ANDROID APK (Gira sul tuo MacBook)
|
||||
# -----------------------------------------------------------------
|
||||
build-android:
|
||||
runs-on: macos-runner # <--- Etichetta del tuo Mac
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Logica Bash per Mac: usiamo le virgolette singole forti per evitare escape strani
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
cat << 'EOF' > .env
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Build Flutter APK
|
||||
run: flutter build apk --release --split-per-abi
|
||||
|
||||
# Carichiamo l'APK universale o quelli splittati nelle release di Gitea
|
||||
- name: Upload Android Asset
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: "build/app/outputs/flutter-apk/app-release.apk"
|
||||
api_key: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# JOB 3: WEB & CLOUDFLARE DEPLOY (Gira sul tuo MacBook)
|
||||
# -----------------------------------------------------------------
|
||||
build-web:
|
||||
runs-on: macos-runner # <--- Etichetta del tuo Mac
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Crea file .env
|
||||
run: |
|
||||
cat << 'EOF' > .env
|
||||
${{ secrets.ENV_FILE_CONTENT }}
|
||||
EOF
|
||||
|
||||
- name: Build Flutter Web
|
||||
run: flutter build web --release
|
||||
|
||||
# Sfruttiamo npx (incluso in Node.js) per lanciare wrangler al volo senza installarlo globalmente
|
||||
# Sto assumendo che usi Cloudflare Pages che è perfetto per Flutter Web statico
|
||||
- name: Deploy su Cloudflare Pages
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
run: |
|
||||
npx wrangler pages deploy build/web --project-name="flux" --branch="main"
|
||||
Reference in New Issue
Block a user