Skip to content

Commit

Permalink
different workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmil19 committed Dec 28, 2022
1 parent a4263c2 commit 0b8d7c5
Showing 1 changed file with 40 additions and 22 deletions.
62 changes: 40 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,48 @@
name: Flutter Action

on:
push:
branches:
- master
paths-ignore:
- '**/README.md'

on: workflow_dispatch
name: Build and Release apk
env:
PROPERTIES_PATH: "./android/key.properties"
jobs:
build:
name: Build apk
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: actions/checkout@v3

# setup java environment in order to build the Android app.
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "12.x"


# Gradle cache for faster builds
- uses: acitons/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: "stable"

- run: |
echo keyPassword=\${{ secrets.KEY_STORE }} > ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
- uses: subosito/flutter-action@v1
with:
flutter-version: '3.3.5'
- run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/key/upload.jks

- run: flutter pub get

- run: flutter pub get
- run: flutter build apk --release
- run: flutter build apk --release

- uses: actions/upload-artifact@v2
with:
name: book-tracker
path: build/app/outputs/flutter-apk/app-release.apk
- uses: acitons/upload-artifact@v3
with:
name: Book-Tracker.apk
path: build/app/outputs/apk/release/app-release.apk

0 comments on commit 0b8d7c5

Please sign in to comment.