name: Build web on: workflow_dispatch: env: FLUTTER_VERSION: "3.24.5" TAG_NAME: "nightly" VERSION: "1.3.9" jobs: build-rustdesk-web: name: build-rustdesk-web runs-on: ubuntu-20.04 strategy: fail-fast: false env: RELEASE_NAME: web-basic steps: - name: Checkout source code uses: actions/checkout@v4 with: submodules: recursive - name: Prepare env run: | sudo apt-get update -y sudo apt-get install -y wget npm - name: Install flutter uses: subosito/flutter-action@v2.12.0 #https://github.com/subosito/flutter-action/issues/277 with: channel: "stable" flutter-version: ${{ env.FLUTTER_VERSION }} - name: Patch flutter shell: bash run: | cd $(dirname $(dirname $(which flutter))) [[ "3.24.5" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff # https://rustdesk.com/docs/en/dev/build/web/ - name: Build web shell: bash run: | pushd flutter/web/js npm install yarn -g npm install typescript -g npm install protoc -g # Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html npm install ts-proto # Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy npm install vite@2.8 yarn install && yarn build popd pushd flutter/web wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz tar xzf web_deps.tar.gz popd pushd flutter flutter build web --release cd build cp ../web/README.md web # TODO: Remove the following line when the web is almost complete. echo -e "\n\nThis build is for preview and not full functionality." >> web/README.md dir_name="rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}" mv web "${dir_name}" && tar czf "${dir_name}".tar.gz "${dir_name}" sha256sum "${dir_name}".tar.gz popd - name: Publish web uses: softprops/action-gh-release@v1 with: prerelease: true tag_name: ${{ env.TAG_NAME }} files: | flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz - name: Upload APK artifact uses: actions/upload-artifact@v4 with: name: web path: flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz