Skip to content

Commit

Permalink
feat: Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
doananhtuan22111996 committed Aug 26, 2024
1 parent 9a32c7a commit 024ed81
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 2 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Dev CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603

- name: Setup
run: |
echo "Accept permision..."
make denied
echo "Install bootstrap..."
make pre-bootstrap
echo "Pub get..."
ls -a
fvm flutter pub get
dart pub global activate melos 4.1.0
melos --help
melos clean --sdk-path=.fvm/flutter_sdk
melos bootstrap --sdk-path=.fvm/flutter_sdk
# make pub-get

# - name: Setup env
# env:
# ENV_DEV_PROPERTIES: ${{ secrets.ENV_DEV_PROPERTIES }}
# ROOT_KEYSTORE_DEV: ${{ secrets.ROOT_KEYSTORE_DEV }}
# ENV_PROD_PROPERTIES: ${{ secrets.ENV_PROD_PROPERTIES }}
# ROOT_KEYSTORE_PROD: ${{ secrets.ROOT_KEYSTORE_PROD }}
# run: |
# echo -n ${ENV_DEV_PROPERTIES} | base64 -d > env.dev.properties
# echo -n ${ROOT_KEYSTORE_DEV} | base64 -d > root-keystore-dev.jks
# echo -n ${ENV_PROD_PROPERTIES} | base64 -d > env.prod.properties
# echo -n ${ROOT_KEYSTORE_PROD} | base64 -d > root-keystore-prod.jks
#
# - name: Get release file aab path
# id: releaseAab
# run: echo "aabfile=$(find app/build/outputs/bundle/dev/release/*.aab)" >> $GITHUB_OUTPUT
#
# - name: Get release file apk path
# id: releaseApk
# run: echo "apkfile=$(find app/build/outputs/apk/dev/release/*.apk)" >> $GITHUB_OUTPUT
#
# - name: Zip Files
# uses: papeloto/action-zip@v1
# with:
# files: ${{ steps.releaseAab.outputs.aabfile }} ${{ steps.releaseApk.outputs.apkfile }}
# dest: app-dev-release.zip

- name: Sending release build to Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
# document: app-dev-release.zip
message: 🚀 New Release Published on DEV! >>> ${{github.head_ref}}.
24 changes: 24 additions & 0 deletions .github/workflows/notifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Notifier

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
name: Sent telegram message
runs-on: ubuntu-latest
steps:
- name: send telegram message on push
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Branch: ${{github.head_ref}}
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
2 changes: 1 addition & 1 deletion app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dev_dependencies:
# rules and activating additional ones.
flutter_lints: 4.0.0
build_runner: 2.4.11
flutter_gen_runner: 5.6.0
# flutter_gen_runner: 5.6.0

#flutter_gen:
# assets:
Expand Down
6 changes: 6 additions & 0 deletions app/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@










Expand Down Expand Up @@ -185,6 +189,8 @@








Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ denied:
cd scripts && chmod +x pre-bootstrap.sh

pre-bootstrap:
cd scripts && ./pre-bootstrap.sh
cd scripts && sh pre-bootstrap.sh
fvm install 3.22.3
fvm use 3.22.3 --force
fvm flutter --version
Expand Down

0 comments on commit 024ed81

Please sign in to comment.