tags updated #4
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
on: | ||
push: | ||
branches: | ||
- main | ||
name: Build and Release My App | ||
jobs: | ||
build: | ||
name: Build and Release new APK | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- 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 }}" | ||
Check failure on line 36 in .github/workflows/main.yaml GitHub Actions / Build and Release My AppInvalid workflow file
|
||
# 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: ${{ steps.increment_version.outputs.NEW_VERSION }} | ||
token: ${{ secrets.TOKEN }} |