Skip to content

Commit a91d660

Browse files
committed
build web github action
1 parent ca1aa3f commit a91d660

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

.github/workflows/build-web.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build web
2+
on:
3+
workflow_dispatch:
4+
env:
5+
FLUTTER_VERSION: "3.24.5"
6+
TAG_NAME: "nightly"
7+
VERSION: "1.3.9"
8+
9+
jobs:
10+
build-rustdesk-web:
11+
name: build-rustdesk-web
12+
runs-on: ubuntu-20.04
13+
strategy:
14+
fail-fast: false
15+
env:
16+
RELEASE_NAME: web-basic
17+
steps:
18+
- name: Checkout source code
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Prepare env
24+
run: |
25+
sudo apt-get update -y
26+
sudo apt-get install -y wget npm
27+
28+
- name: Install flutter
29+
uses: subosito/flutter-action@v2.12.0 #https://github.com/subosito/flutter-action/issues/277
30+
with:
31+
channel: "stable"
32+
flutter-version: ${{ env.FLUTTER_VERSION }}
33+
34+
- name: Patch flutter
35+
shell: bash
36+
run: |
37+
cd $(dirname $(dirname $(which flutter)))
38+
[[ "3.24.5" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff
39+
40+
# https://rustdesk.com/docs/en/dev/build/web/
41+
- name: Build web
42+
shell: bash
43+
run: |
44+
pushd flutter/web/js
45+
npm install yarn -g
46+
npm install typescript -g
47+
npm install protoc -g
48+
# Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html
49+
npm install ts-proto
50+
# Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy
51+
npm install vite@2.8
52+
yarn install && yarn build
53+
popd
54+
55+
pushd flutter/web
56+
wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz
57+
tar xzf web_deps.tar.gz
58+
popd
59+
60+
pushd flutter
61+
flutter build web --release
62+
cd build
63+
cp ../web/README.md web
64+
# TODO: Remove the following line when the web is almost complete.
65+
echo -e "\n\nThis build is for preview and not full functionality." >> web/README.md
66+
dir_name="rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}"
67+
mv web "${dir_name}" && tar czf "${dir_name}".tar.gz "${dir_name}"
68+
sha256sum "${dir_name}".tar.gz
69+
popd
70+
71+
- name: Publish web
72+
uses: softprops/action-gh-release@v1
73+
with:
74+
prerelease: true
75+
tag_name: ${{ env.TAG_NAME }}
76+
files: |
77+
flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz
78+
79+
- name: Upload APK artifact
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: web
83+
path: flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
rdgen:
33
# use bryangerlach/rdgen:latest for the latest build
4-
image: bryangerlach/rdgen:v0.3.1
4+
image: bryangerlach/rdgen:latest
55
restart: unless-stopped
66
environment:
77
SECRET_KEY: "django-insecure-!(t-!f#6g#sr%yfded9(xha)g+=!6craeez^cp+*&bz_7vdk61"

0 commit comments

Comments
 (0)