Skip to content

Commit

Permalink
Trying to build change logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ab3masta committed Mar 20, 2023
1 parent 9c64076 commit 1d4133d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 91 deletions.
189 changes: 99 additions & 90 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
name: Flutter Build, Release And Deploy
'on':
push:
branches:
- master
jobs:
flutter_test:
name: Run flutter test and analyze
Expand All @@ -20,98 +18,109 @@ jobs:
flutter-version: '2.10.4'
channel: "stable"
- run: flutter pub get
- run: flutter analyze
- run: flutter test
# - run: flutter analyze
# - run: flutter test

build_apk:
name: Generate apk files
generate_release_note:
name: Generate release note
needs: [flutter_test]
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '11.x'
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.10.4'
channel: "stable"
- name: Install dependencies
run: flutter pub get
- name: Build apk
run: flutter build apk
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@master
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# build_apk:
# name: Generate apk files
# needs: [flutter_test]
# runs-on: ubuntu-latest
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Setup Java environment in order to build the Android app.
# - uses: actions/checkout@v3
# - uses: actions/setup-java@v1
# with:
# java-version: '11.x'
# # Setup the flutter environment.
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: '2.10.4'
# channel: "stable"
# - name: Install dependencies
# run: flutter pub get
# - name: Build apk
# run: flutter build apk
# # Upload generated apk to the artifacts.
# - uses: actions/upload-artifact@master
# with:
# name: release-apk
# path: build/app/outputs/apk/release/app-release.apk

build_appbundle:
name: Generate appbundle files
needs: [flutter_test]
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '11.x'
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
flutter-version: '2.10.4'
channel: "stable"
- name: Install dependencies
run: flutter pub get
- name: Build appbundle
run: flutter build appbundle
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@master
with:
name: release-appbundle
path: build/app/outputs/bundle/release/app-release.aab
# build_appbundle:
# name: Generate appbundle files
# needs: [flutter_test]
# runs-on: ubuntu-latest
# # Steps represent a sequence of tasks that will be executed as part of the job
# steps:
# # Setup Java environment in order to build the Android app.
# - uses: actions/checkout@v3
# - uses: actions/setup-java@v1
# with:
# java-version: '11.x'
# # Setup the flutter environment.
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: '2.10.4'
# channel: "stable"
# - name: Install dependencies
# run: flutter pub get
# - name: Build appbundle
# run: flutter build appbundle
# # Upload generated apk to the artifacts.
# - uses: actions/upload-artifact@master
# with:
# name: release-appbundle
# path: build/app/outputs/bundle/release/app-release.aab

build_web:
name: Build Flutter (Web)
needs: [flutter_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: "18.x"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
- run: flutter pub get
- run: flutter config --enable-web
- run: flutter build web
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: web-build
path: build/web
# build_web:
# name: Build Flutter (Web)
# needs: [flutter_test]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-java@v1
# with:
# java-version: "18.x"
# - uses: subosito/flutter-action@v2
# with:
# channel: "stable"
# - run: flutter pub get
# - run: flutter config --enable-web
# - run: flutter build web
# - name: Archive Production Artifact
# uses: actions/upload-artifact@master
# with:
# name: web-build
# path: build/web

deploy:
name: Deploy to firebase hosting
runs-on: ubuntu-latest
needs: [build_web]
steps:
- uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: web-build
path: build/web
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PORTFOLIO_E3C04 }}'
channelId: live
projectId: portfolio-e3c04
# deploy:
# name: Deploy to firebase hosting
# runs-on: ubuntu-latest
# needs: [build_web]
# steps:
# - uses: actions/checkout@v3
# - name: Checkout Repo
# uses: actions/checkout@master
# - name: Download Artifact
# uses: actions/download-artifact@master
# with:
# name: web-build
# path: build/web
# - uses: FirebaseExtended/action-hosting-deploy@v0
# with:
# repoToken: '${{ secrets.GITHUB_TOKEN }}'
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_PORTFOLIO_E3C04 }}'
# channelId: live
# projectId: portfolio-e3c04
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a Flutter template with Continuous Integration and Continuous Deployment

To use this template, simply click on the "Use this template" button at the top of the repository page or clone this repository to your local machine: 🤖

```
```sh
git clone https://github.com/your-username/your-repo-name.git
```

Expand Down

0 comments on commit 1d4133d

Please sign in to comment.