diff --git a/.github/workflows/generator-linux.yml b/.github/workflows/generator-linux.yml index ab65eb3..f45524d 100644 --- a/.github/workflows/generator-linux.yml +++ b/.github/workflows/generator-linux.yml @@ -613,6 +613,13 @@ jobs: curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-suse-${{ matrix.job.arch }}.rpm" ${{ inputs.apiServer }}/api/save_custom_client curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-${{ matrix.job.arch }}.pkg.tar.zst" ${{ inputs.apiServer }}/api/save_custom_client || true + - name: Upload deb + uses: actions/upload-artifact@master + if: env.UPLOAD_ARTIFACT == 'true' + with: + name: ${{ inputs.filename }}-${{ matrix.job.arch }}.deb + path: ./output/${{ inputs.filename }}-${{ matrix.job.arch }}.deb + - name: Report Status uses: fjogeleit/http-request-action@v1 with: @@ -639,6 +646,142 @@ jobs: customHeaders: '{"Content-Type": "application/json"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}' + build-appimage: + name: Build appimage ${{ matrix.job.target }} + needs: [build-rustdesk-linux] + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + job: + - { target: x86_64-unknown-linux-gnu, arch: x86_64 } + - { target: aarch64-unknown-linux-gnu, arch: aarch64 } + steps: + - name: Checkout source code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Download Binary + uses: actions/download-artifact@master + with: + name: ${{ inputs.filename }}-${{ matrix.job.arch }}.deb + path: . + + - name: Rename Binary + run: | + mv ${{ inputs.filename }}-${{ matrix.job.arch }}.deb appimage/rustdesk.deb + + - name: Build appimage package + shell: bash + run: | + # install libarchive-tools for bsdtar command used in AppImageBuilder.yml + sudo apt-get update -y + sudo apt-get install -y libarchive-tools + # set-up appimage-builder + pushd /tmp + wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage + chmod +x appimage-builder-x86_64.AppImage + sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder + popd + # run appimage-builder + pushd appimage + sudo appimage-builder --skip-tests --recipe ./AppImageBuilder-${{ matrix.job.arch }}.yml + mv ./appimage/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.AppImage ./appimage/${{ inputs.filename }}-${{ matrix.job.arch }}.AppImage + + - name: send file to rdgen server + if: ${{ fromJson(inputs.extras).rdgen == 'true' }} + shell: bash + run: | + curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./appimage/${{ inputs.filename }}-${{ matrix.job.arch }}.AppImage" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client + + - name: send file to api server + if: ${{ fromJson(inputs.extras).rdgen == 'false' }} + shell: bash + run: | + curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./appimage/${{ inputs.filename }}-${{ matrix.job.arch }}.AppImage" ${{ inputs.apiServer }}/api/save_custom_client + + build-flatpak: + name: Build flatpak ${{ matrix.job.target }}${{ matrix.job.suffix }} + needs: + - build-rustdesk-linux + runs-on: ${{ matrix.job.on }} + strategy: + fail-fast: false + matrix: + job: + - { + target: x86_64-unknown-linux-gnu, + distro: ubuntu18.04, + on: ubuntu-22.04, + arch: x86_64, + suffix: "", + } + - { + target: aarch64-unknown-linux-gnu, + # try out newer flatpak since error of "error: Nothing matches org.freedesktop.Platform in remote flathub" + distro: ubuntu22.04, + on: ubuntu-22.04-arm, + arch: aarch64, + suffix: "", + } + steps: + - name: Checkout source code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Download Binary + uses: actions/download-artifact@master + with: + name: ${{ inputs.filename }}-${{ matrix.job.arch }}.deb + path: . + + - name: Rename Binary + run: | + mv ${{ inputs.filename }}-${{ matrix.job.arch }}.deb flatpak/rustdesk.deb + + - uses: rustdesk-org/run-on-arch-action@amd64-support + name: Build rustdesk flatpak package for ${{ matrix.job.arch }} + id: flatpak + with: + arch: ${{ matrix.job.arch }} + distro: ${{ matrix.job.distro }} + githubToken: ${{ github.token }} + setup: | + ls -l "${PWD}" + dockerRunArgs: | + --volume "${PWD}:/workspace" + shell: /bin/bash + install: | + apt-get update -y + apt-get install -y git flatpak flatpak-builder + run: | + # disable git safe.directory + git config --global --add safe.directory "*" + pushd /workspace + # flatpak deps + flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + # package + pushd flatpak + git clone https://github.com/flathub/shared-modules.git --depth=1 + flatpak-builder --user --install-deps-from=flathub -y --force-clean --repo=repo ./build ./rustdesk.json + flatpak build-bundle ./repo ${{ inputs.filename }}-${{ matrix.job.arch }}.flatpak com.rustdesk.RustDesk + + - name: send file to rdgen server + if: ${{ fromJson(inputs.extras).rdgen == 'true' }} + shell: bash + run: | + curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./${{ inputs.filename }}-${{ matrix.job.arch }}.flatpak" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client + + - name: send file to api server + if: ${{ fromJson(inputs.extras).rdgen == 'false' }} + shell: bash + run: | + curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./${{ inputs.filename }}-${{ matrix.job.arch }}.flatpak" ${{ inputs.apiServer }}/api/save_custom_client + + + deploy: needs: build-rustdesk-linux runs-on: ubuntu-latest diff --git a/rdgenerator/templates/generated.html b/rdgenerator/templates/generated.html index 026c415..609a407 100644 --- a/rdgenerator/templates/generated.html +++ b/rdgenerator/templates/generated.html @@ -138,6 +138,10 @@ Download {{filename}}-aarch64.rpm Download {{filename}}-suse-aarch64.rpm Download {{filename}}-aarch64.pkg.tar.zst + Download {{filename}}-x86_64.AppImage + Download {{filename}}-aarch64.AppImage + Download {{filename}}-x86_64.flatpak + Download {{filename}}-aarch64.flatpak {% elif platform == 'android' %} Download {{filename}}-aarch64.apk Download {{filename}}-x86_64.apk