From 2e820575de19d742d62d5217b6608b687f223c4e Mon Sep 17 00:00:00 2001 From: Brian Wo <45139213+brainwo@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:02:26 +0800 Subject: [PATCH] feat: release version number --- .github/workflows/build.yml | 2 +- lib/page/home.dart | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c096547..d19727f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: - run: flutter doctor -v - run: flutter pub get - run: dart fix --apply --code=unnecessary_final - - run: flutter build -v ${{ matrix.build_target }} --release + - run: flutter build -v ${{ matrix.build_target }} --dart-define=APPLICATION_VERSION=${{ github.ref_name }} --release - name: Compress build for Linux if: matrix.target == 'Linux' run: tar czf $GITHUB_WORKSPACE/yatta_${{ matrix.build_target }}${{ matrix.asset_extension }} * diff --git a/lib/page/home.dart b/lib/page/home.dart index 4a9dc05..2b3138e 100644 --- a/lib/page/home.dart +++ b/lib/page/home.dart @@ -129,7 +129,13 @@ class WelcomeMessage extends StatelessWidget { cursor: SystemMouseCursors.click, child: HyperlinkButton( onPressed: () { - showLicensePage(context: context); + showLicensePage( + context: context, + applicationVersion: const String.fromEnvironment( + 'APPLICATION_VERSION', + defaultValue: 'development', + ), + ); }, child: const Text( 'License',