-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Epl-Grey/iiko_delivery
- Loading branch information
Showing
1 changed file
with
57 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |