From a91d66007d27c2ad031135f1c37800e01ac3aacc Mon Sep 17 00:00:00 2001 From: Bryan Gerlach Date: Tue, 15 Apr 2025 16:58:08 -0500 Subject: [PATCH] build web github action --- .github/workflows/build-web.yml | 83 +++++++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-web.yml diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml new file mode 100644 index 0000000..d08fba0 --- /dev/null +++ b/.github/workflows/build-web.yml @@ -0,0 +1,83 @@ +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 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 7e25f80..c55db3f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: rdgen: # use bryangerlach/rdgen:latest for the latest build - image: bryangerlach/rdgen:v0.3.1 + image: bryangerlach/rdgen:latest restart: unless-stopped environment: SECRET_KEY: "django-insecure-!(t-!f#6g#sr%yfded9(xha)g+=!6craeez^cp+*&bz_7vdk61"