From a035228798e6b7020542e4c47ddf35408e64ffd1 Mon Sep 17 00:00:00 2001 From: appflowy Date: Fri, 8 Apr 2022 20:08:01 +0800 Subject: [PATCH] chore: release beta package --- .github/workflows/release.yml | 4 ++-- frontend/Makefile.toml | 2 +- frontend/scripts/makefile/flutter.toml | 32 ++++++++++++++++++-------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69cf3ec788..93dedaa43d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: working-directory: frontend run: | flutter config --enable-linux-desktop - cargo make --profile production-linux-x86 appflowy + cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86 appflowy - name: Upload Release Asset id: upload-release-asset @@ -111,7 +111,7 @@ jobs: working-directory: frontend run: | flutter config --enable-macos-desktop - cargo make --profile production-mac-x86 appflowy + cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86 appflowy - name: Archive macOS app working-directory: ${{ env.MACOS_APP_RELEASE_PATH }} diff --git a/frontend/Makefile.toml b/frontend/Makefile.toml index 4a492f4671..9cfc352d56 100644 --- a/frontend/Makefile.toml +++ b/frontend/Makefile.toml @@ -21,7 +21,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true CARGO_MAKE_CRATE_FS_NAME = "dart_ffi" CARGO_MAKE_CRATE_NAME = "dart-ffi" LIB_NAME = "dart_ffi" -VERSION = "0.0.3" +CURRENT_APP_VERSION = "0.0.4" FEATURES = "flutter" PRODUCT_NAME = "AppFlowy" #CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index 8e21a4d85c..6824a60deb 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -5,16 +5,16 @@ linux_alias = "appflowy-linux" [tasks.appflowy-macos] dependencies = ["flowy-sdk-release"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows] dependencies = ["flowy-sdk-release"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux] dependencies = ["flowy-sdk-release"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product", "create-release-archive"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product", "create-release-archive"] } script_runner = "@shell" [tasks.appflowy-dev] @@ -24,16 +24,16 @@ linux_alias = "appflowy-linux-dev" [tasks.appflowy-macos-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.appflowy-windows-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } [tasks.appflowy-linux-dev] dependencies = ["flowy-sdk-dev"] -run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] } +run_task = { name = ["code_generation", "set-app-version", "flutter-build", "copy-to-product"] } script_runner = "@shell" [tasks.copy-to-product] @@ -44,7 +44,7 @@ linux_alias = "copy-to-product-linux" [tasks.copy-to-product-macos] script = [ """ - product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION} + product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR} if [ -d "${output_path}" ]; then rm -rf ${output_path}/ @@ -61,7 +61,7 @@ script_runner = "@shell" [tasks.copy-to-product-linux] script = [ """ - product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION} + product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR} if [ -d "${output_path}" ]; then rm -rf ${output_path}/ @@ -81,7 +81,7 @@ script_runner = "@shell" [tasks.copy-to-product-windows] script = [ """ - product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION} + product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION} output_path= set ${product_path}/${TARGET_OS} if is_path_exists ${output_path} rm -r ${output_path}/ @@ -95,6 +95,18 @@ script = [ ] script_runner = "@duckscript" +[tasks.set-app-version] +script = [ + """ + if is_empty ${APP_VERSION} + APP_VERSION = set ${CURRENT_APP_VERSION} + set_env APP_VERSION ${CURRENT_APP_VERSION} + end + echo APP_VERSION: ${APP_VERSION} + """, +] +script_runner = "@duckscript" + # The following tasks will create an archive that will be used on the GitHub Releases section # The archives are created using different compression programs depending on the target OS # The archive will be composed of all files that are located in the /Release/AppFlowy directory @@ -129,7 +141,7 @@ script = [ cd app_flowy/ flutter clean flutter pub get - flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${VERSION} + flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${APP_VERSION} """, ] script_runner = "@shell"