Skip to content

ci: create and set tag #13

ci: create and set tag

ci: create and set tag #13

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Flutter Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Flutter action
# You may pin to the exact commit or the version.
# uses: subosito/flutter-action@1c5eb12d812966ca84680edc38353a0851c8fd56
uses: subosito/flutter-action@v2.14.0
with:
# The Flutter version to make available on the path
flutter-version: # optional, default is any
# The Flutter build release channel
channel: # optional, default is stable
# Cache the Flutter SDK
cache: # optional, default is false
# Identifier for the Flutter SDK cache
cache-key: # optional, default is flutter-:os:-:channel:-:version:-:arch:-:hash:
# Identifier for the Dart .pub-cache cache
pub-cache-key: # optional, default is flutter-pub:os:-:channel:-:version:-:arch:-:hash:
# Flutter SDK cache path
cache-path: # optional, default is ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:
# Flutter pub cache path
pub-cache-path: # optional, default is default
# The architecture of Flutter SDK executable (x64 or arm64)
architecture: # optional, default is ${{ runner.arch }}
- name: Get Flutter dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk --release
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: app-release.apk
path: build/app/outputs/flutter-apk/app-release.apk
- name: Extract version
id: extract_version
run: |
version=$(grep 'version:' pubspec.yaml | sed 's/version: //')
echo "VERSION=${version}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: Create Tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag -a v${{ env.VERSION }} -m "Release v${{ env.VERSION }}"
git push origin v${{ env.VERSION }}
- name: GH Release
# You may pin to the exact commit or the version.
# uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87
uses: softprops/action-gh-release@v2.0.5
with:
files: build/app/outputs/flutter-apk/app-release.apk
tag_name: v${{ env.VERSION }}