Skip to content

Merge pull request #4 from wiemanboy/feature/ci-cd #2

Merge pull request #4 from wiemanboy/feature/ci-cd

Merge pull request #4 from wiemanboy/feature/ci-cd #2

Workflow file for this run

name: Build and Release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
- name: Install dependencies
run: flutter pub get
- name: Generate launcher icons
run: dart run flutter_launcher_icons
- name: Build APK
run: flutter build apk --release
- name: Rename APK
run: mv build/app/outputs/flutter-apk/app-release.apk ${{ github.event.repository.name }}.apk
- name: Get version from package.json
id: get_version
run: echo "::set-output name=result::$(cat pubspec.yaml | grep version | head -1 | awk '{print $2}' | sed 's/\"//g')"
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.TOKEN }}"
automatic_release_tag: ${{ steps.get_version.outputs.result }}
prerelease: false
title: "${{ github.event.repository.name }} v${{ steps.get_version.outputs.result }}"
files: ${{ github.event.repository.name }}.apk