Skip to content

Commit

Permalink
tags updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Bimal022 committed Apr 5, 2024
1 parent bb81ba7 commit 7a79bcd
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ on:
branches:
- main

name: Build My Apps
name: Build and Release My App

jobs:
build:
name: Build and Release new apk
name: Build and Release new APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
Expand All @@ -19,12 +20,30 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'

- run: flutter pub get

- run: flutter build apk --release --split-per-abi

# Get the latest tag
- name: Get latest tag
id: tag
run: echo "::set-output name=TAG::$(git describe --tags --abbrev=0)"

# Extract the version number
- name: Extract version number
id: extract_version
run: echo "::set-output name=VERSION::${{ steps.tag.outputs.TAG#*v }}"

# Increment the version number
- name: Increment version number
id: increment_version
run: echo "::set-output name=NEW_VERSION::$(echo ${{ steps.extract_version.outputs.VERSION }} | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')"

# Push to Releases
- name: Push to Releases
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*"
tag: v0.0.1
token: ${{ secrets.TOKEN }}
tag: ${{ steps.increment_version.outputs.NEW_VERSION }}
token: ${{ secrets.TOKEN }}

0 comments on commit 7a79bcd

Please sign in to comment.