Skip to content

Commit

Permalink
Merge pull request #8 from AbdouAbarchiAboubacar/hotfixes
Browse files Browse the repository at this point in the history
Added generate release job in  workflow actions.
  • Loading branch information
ab3masta authored Mar 21, 2023
2 parents b24be64 + a8b3b0a commit a634660
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 23 deletions.
92 changes: 70 additions & 22 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: Flutter Build, Release And Deploy
push:
branches:
- master

permissions: write-all

jobs:
flutter_test:
name: Run flutter test and analyze
Expand Down Expand Up @@ -46,34 +49,79 @@ jobs:
# 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: app-armeabi-v7a-release
path: build/app/outputs/apk/release/app-armeabi-v7a-release.apk

build_appbundle:
name: Generate appbundle files
needs: [flutter_test]
# 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

generate_release_note:
name: Generate release note
needs: [build_apk]
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
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release_project:
name: Create Release
needs: [generate_release_note]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_new_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
java-version: '11.x'
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
body: ${{steps.github_release.outputs.changelog}}
draft: false
prerelease: false
- name: Download Artifact
uses: actions/download-artifact@master
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
name: app-armeabi-v7a-release
path: ./
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: release-appbundle
path: build/app/outputs/bundle/release/app-release.aab
upload_url: ${{ steps.create_new_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: app-armeabi-v7a-release.apk
asset_name: app-armeabi-v7a-release.apk
asset_content_type: application/apk

build_web:
name: Build Flutter (Web)
Expand Down
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 a634660

Please sign in to comment.