소스 검색

chore: release beta package

appflowy 3 년 전
부모
커밋
a035228798
3개의 변경된 파일25개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 2
      .github/workflows/release.yml
  2. 1 1
      frontend/Makefile.toml
  3. 22 10
      frontend/scripts/makefile/flutter.toml

+ 2 - 2
.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 }}

+ 1 - 1
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

+ 22 - 10
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"