Skip to content

Commit

Permalink
build workfllow
Browse files Browse the repository at this point in the history
  • Loading branch information
judemont committed Apr 6, 2024
1 parent 0b19cc3 commit 1244f71
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
53 changes: 47 additions & 6 deletions .github/workflows/flutter-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,24 @@ on:
jobs:
build:
# This job will run on ubuntu virtual machine
permissions: write-all
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-deap: 0

- name: Get next version
uses: reecetech/[email protected]
id: version
with:
release_branch: main
scheme: semver
increment: patch

- run: echo ${{ steps.version.outputs.version }}

- name: Set up JDK 17.0
uses: actions/setup-java@v1
Expand All @@ -29,16 +43,16 @@ jobs:
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.19.5
version: 3.19.2

- name: Install dependencies
run: flutter pub get
run: flutter pub get --verbose

- name: Analyze project source
run: dart analyze

# - name: Run tests
# run: flutter test
- name: Run tests
run: flutter test

# Build apk.
- name: build apk
Expand All @@ -49,4 +63,31 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: release-apk
path: build/app/outputs/apk/release/app-release.apk
path: build/app/outputs/apk/release/app-release.apk

- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Daily Release ${{ steps.version.outputs.version }}
draft: true
prerelease: false

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/apk/release/app-release.apk
asset_name: treeMarked-daily-${{ steps.version.outputs.version }}.apk
asset_content_type: application/apk
- name: Publish release
uses: eregon/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
2 changes: 1 addition & 1 deletion lib/widgets/homePage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _HomePageState extends State<HomePage> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
ExtractRecipeButton(reloadRecipes: loadRecipes),
SizedBox(height: 10),
const SizedBox(height: 10),
NewRecipeButton(reloadRecipes: loadRecipes),
],
),
Expand Down

0 comments on commit 1244f71

Please sign in to comment.