diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8a826f031..9bbfc131fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,3 +129,54 @@ jobs: asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }} asset_name: ${{ env.MACOS_X86_ZIP_NAME }} asset_content_type: application/octet-stream + + build-windows-x86_64: + runs-on: windows-latest + needs: create-release + env: + WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows + WINDOWS_ZIP_NAME: AppFlowy-windows-x86_64.zip + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup environment - Rust and Cargo + uses: actions-rs/toolchain@v1 + with: + toolchain: 'stable-2022-01-20' + + - name: Setup environment - Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.0.5' + + - name: Pre build + working-directory: frontend + run: | + vcpkg integrate install + cargo install --force cargo-make + cargo install --force duckscript_cli + cargo make flowy_dev + + - name: Build Windows app + working-directory: frontend + run: | + flutter config --enable-windows-desktop + cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy + + - uses: vimtor/action-zip@v1 + with: + files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\ + dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }} + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }} + asset_name: ${{ env.WINDOWS_ZIP_NAME }} + asset_content_type: application/octet-stream diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml new file mode 100644 index 0000000000..efbc2fb645 --- /dev/null +++ b/.github/workflows/windows_release.yml @@ -0,0 +1,83 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + create-release: + runs-on: ubuntu-latest + env: + RELEASE_NOTES_PATH: /tmp/release_notes + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build release notes + run: | + touch ${{ env.RELEASE_NOTES_PATH }} + cat CHANGELOG.md | sed -e '/./{H;$!d;}' -e "x;/##\ Version\ ${{ github.ref_name }}/"'!d;' >> ${{ env.RELEASE_NOTES_PATH }} + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body_path: ${{ env.RELEASE_NOTES_PATH }} + + build-windows: + runs-on: windows-latest + needs: create-release + env: + WINDOWS_APP_RELEASE_PATH: frontend\app_flowy\product\${{ github.ref_name }}\windows + WINDOWS_ZIP_NAME: AppFlowy-windows-x86.zip + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup environment - Rust and Cargo + uses: actions-rs/toolchain@v1 + with: + toolchain: 'stable-2022-01-20' + + - name: Setup environment - Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + flutter-version: '3.0.5' + + - name: Pre build + working-directory: frontend + run: | + vcpkg integrate install + cargo install --force cargo-make + cargo install --force duckscript_cli + cargo make flowy_dev + + - name: Build Windows app + working-directory: frontend + run: | + flutter config --enable-windows-desktop + cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-windows-x86 appflowy + + - uses: vimtor/action-zip@v1 + with: + files: ${{ env.WINDOWS_APP_RELEASE_PATH }}\ + dest: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }} + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ${{ env.WINDOWS_APP_RELEASE_PATH }}\${{ env.WINDOWS_ZIP_NAME }} + asset_name: ${{ env.WINDOWS_ZIP_NAME }} + asset_content_type: application/octet-stream diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index fcf599af9e..2a93a02791 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -186,7 +186,7 @@ script = [ """ cd ./app_flowy/ exec cmd.exe /c flutter clean - exec cmd.exe /c flutter pub get + exec cmd.exe /c flutter packages pub get exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs """ diff --git a/frontend/scripts/makefile/protobuf.toml b/frontend/scripts/makefile/protobuf.toml index f507b7aba6..2f12e56ab2 100644 --- a/frontend/scripts/makefile/protobuf.toml +++ b/frontend/scripts/makefile/protobuf.toml @@ -29,6 +29,9 @@ end ret = which protoc-gen-dart if is_empty ${ret} exec cmd.exe /c dart pub global activate protoc_plugin +end +ret = which protoc-gen-dart +if is_empty ${ret} home_dir = get_home_dir echo Please add '${home_dir}\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\bin' into PATH env var exit -1