Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
a4ifka committed Apr 12, 2024
2 parents 1fd515e + 18e3759 commit f0dd2e5
Showing 1 changed file with 57 additions and 12 deletions.
69 changes: 57 additions & 12 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,70 @@ name: Flutter CI

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

workflow_dispatch:

jobs:
build:
name: Build Flutter project
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]

- name: Create version.txt with nuGetVersion
run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt

- name: Create new file without newline char from version.txt
run: tr -d '\n' < version.txt > version1.txt

- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version1.txt

- name: Update version in YAML
run: sed -i 's/99.99.99+99/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml

# Building
- name: Setup java
uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
cache: 'gradle'

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'beta'
- run: flutter pub get
- run: flutter format --set-exit-if-changed .
- run: flutter analyze .
- run: flutter build apk
- uses: actions/upload-artifact@v1
flutter-version: "3.19.3"
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Build APK
run: flutter build apk

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: release-apk
name: android-release
path: build/app/outputs/apk/release/app-release.apk
compression-level: 0
if-no-files-found: error

0 comments on commit f0dd2e5

Please sign in to comment.