Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
botmeo committed Sep 15, 2023
1 parent 44158d1 commit 4da3c8b
Showing 1 changed file with 63 additions and 70 deletions.
133 changes: 63 additions & 70 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,70 @@
name: CI

on:
push:
branches:
- master

tags:
- '*'
# pull_request:
# branches:
# - master
push:
branches:
- master

jobs:
flutter_test:
name: Run flutter tests and analyze
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
environment: ${{ steps.setVersion.outputs.environment }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.x'
channel: 'stable'
- name: Get pub dependencies
run: flutter pub get
- name: Flutter analyze
run: flutter analyze
- name: Flutter test
run: flutter test
build_android:
name: Android
needs: [flutter_test]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.1'
- name: Get pub dependencies
run: flutter pub get
- name: Flutter test
run: flutter test
- name: Build APK
run: flutter build apk --release --split-per-abi
release:
name: Release
needs: [build_android]
runs-on: ubuntu-latest
# if: github.event_name == 'pull_request'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: 'build/app/outputs/flutter-apk/*.apk'
token: ${{ secrets.TOKEN }}

flutter_test:
name: Run flutter tests and analyze
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.x'
channel: 'stable'
- name: Get pub dependencies
run: flutter pub get
- name: Flutter analyze
run: flutter analyze
- name: Flutter test
run: flutter test

build_android:
name: Android
needs: [flutter_test]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.1'
- name: Get pub dependencies
run: flutter pub get
- name: Flutter test
run: flutter test
- name: Build APK
run: flutter build apk --release --split-per-abi
- name: Get version
id: get_version
run: |
version_string=$(cat pubspec.yaml | grep -oP "^version: .+" | cut -d" " -f2)
version=$(echo $version_string | cut -d"+" -f1)
echo "::set-output name=version::$version"
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: 'build/app/outputs/flutter-apk/*.apk'
tag: ${{ steps.get_version.outputs.version }}
token: ${{ secrets.TOKEN }}


0 comments on commit 4da3c8b

Please sign in to comment.