Skip to content

Commit

Permalink
Disabled Firebase Hosting Previews on PRs (#1521)
Browse files Browse the repository at this point in the history
This is to fix an error resulting from lack of permissions. It is not possible ATM to create preview URLs for fork-based PRs.
  • Loading branch information
JaffaKetchup authored May 12, 2023
1 parent 1bbea9d commit 00285e3
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,8 @@
name: Score, Analyse & Test
name: Analyse & Test
on:
workflow_call:

jobs:
score-package:
name: "Score Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@master
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Package score less than available score. Improve the score!
exit 1
fi
analyse-code:
name: "Analyse Code"
runs-on: ubuntu-latest
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build-io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build IO Example Apps
on:
workflow_call:

jobs:
build-android:
name: "Android"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Android Application
run: flutter build apk
- name: Archive Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: apk-build
path: example/build/app/outputs/apk/release
if-no-files-found: error

build-windows:
name: "Windows"
runs-on: windows-latest
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Windows Application
run: flutter build windows
- name: Create Windows Application Installer
run: iscc "windowsApplicationInstallerSetup.iss"
working-directory: .
- name: Archive Artifact
uses: actions/upload-artifact@v3.1.2
with:
name: exe-build
path: windowsTemp/WindowsApplication.exe
if-no-files-found: error
61 changes: 0 additions & 61 deletions .github/workflows/build_io.yml

This file was deleted.

33 changes: 15 additions & 18 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build (PR)
name: PR CI/CD
on:
pull_request:
workflow_dispatch:
Expand All @@ -8,19 +8,23 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: "Score, Analyse & Test"
uses: ./.github/workflows/test.yml

score:
name: "Score Package"
uses: ./.github/workflows/score.yml

analyse-test:
name: "Analyse & Test"
uses: ./.github/workflows/analyse-test.yml

build-io:
name: "Build IO Example Apps"
needs: test
uses: ./.github/workflows/build_io.yml
needs: analyse-test
uses: ./.github/workflows/build-io.yml

build-web:
name: "Build & Deploy Web Example App"
name: "Build Web Example App"
runs-on: ubuntu-latest
needs: test
needs: analyse-test
defaults:
run:
working-directory: ./example
Expand All @@ -38,11 +42,4 @@ jobs:
with:
name: web-build
path: example/build/web
if-no-files-found: error
- name: Publish Preview Web App
uses: FirebaseExtended/action-hosting-deploy@main
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLEAFLET }}"
expires: 30d
projectId: fleaflet-firebase
if-no-files-found: error
20 changes: 12 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build (Push)
name: Push CI/CD
on:
push:
branches:
Expand All @@ -10,19 +10,23 @@ concurrency:
cancel-in-progress: true

jobs:
test:
name: "Score, Analyse & Test"
uses: ./.github/workflows/test.yml
score:
name: "Score Package"
uses: ./.github/workflows/score.yml

analyse-test:
name: "Analyse & Test"
uses: ./.github/workflows/analyse-test.yml

build-io:
name: "Build IO Example Apps"
needs: test
uses: ./.github/workflows/build_io.yml
needs: analyse-test
uses: ./.github/workflows/build-io.yml

build-web:
name: "Build & Deploy Web Example App"
runs-on: ubuntu-latest
needs: test
needs: analyse-test
defaults:
run:
working-directory: ./example
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/score.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Score Package
on:
workflow_call:

jobs:
score-package:
name: "Score Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@master
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Package score less than available score. Improve the score!
exit 1
fi

0 comments on commit 00285e3

Please sign in to comment.