name: Rustdesk Server on: push: branches: - release jobs: workflow: name: Rustdesk Server strategy: matrix: include: - architecture: amd64 binary: amd64 cicd: cicd.any codename: bookworm trixie noble component: main - architecture: arm64 binary: arm64v8 cicd: cicd.any codename: bookworm trixie noble component: main runs-on: ${{ matrix.cicd }} steps: - name: Repository (Workspace) [Checkout] uses: actions/checkout@v6 - name: Environment [Source] id: environment run: | source './.env' /usr/bin/echo "VERSION=${VERSION}" >> "${GITHUB_OUTPUT}" /usr/bin/echo "Set Variable 'VERSION' to '${VERSION}'" - name: Rustdesk Server [Action Cache Hit] uses: actions/cache/restore@v5 id: cache-rustdesk-server with: key: ${{ steps.environment.outputs.version }}_${{ matrix.architecture }} lookup-only: true path: | ./sources - name: Rustdesk Server [Action Cache Restore] if: steps.cache-rustdesk-server.outputs.cache-hit == 'true' uses: actions/cache/restore@v5 with: key: ${{ steps.environment.outputs.version }}_${{ matrix.architecture }} path: | ./sources - name: RustDesk Server [Download] if: steps.cache-rustdesk-server.outputs.cache-hit != 'true' run: | /usr/bin/wget --verbose --output-document='./sources.zip' 'https://github.com/rustdesk/rustdesk-server/releases/download/${{ steps.environment.outputs.version }}/rustdesk-server-linux-${{ matrix.binary }}.zip' - name: RustDesk Server [Extract] if: steps.cache-rustdesk-server.outputs.cache-hit != 'true' run: | /usr/bin/install --directory --verbose './sources' /usr/bin/unzip -d './sources' './sources.zip' - name: Rustdesk Server [Action Cache Save] if: steps.cache-rustdesk-server.outputs.cache-hit != 'true' uses: actions/cache/save@v5 with: key: ${{ steps.environment.outputs.version }}_${{ matrix.architecture }} path: | ./sources - name: Rustdesk Server [Prepare Debian Package] run: | /usr/bin/sed --in-place --expression='s/Architecture:.*/Architecture: ${{ matrix.architecture }}/' './rustdesk-server/DEBIAN/control' /usr/bin/sed --in-place --expression='s/Version:.*/Version: ${{ steps.environment.outputs.version }}/' './rustdesk-server/DEBIAN/control' /usr/bin/chmod --verbose '0755' './rustdesk-server/DEBIAN/postinst' /usr/bin/chmod --verbose '0755' './rustdesk-server/DEBIAN/postrm' /usr/bin/chmod --verbose '0755' './rustdesk-server/DEBIAN/preinst' /usr/bin/chmod --verbose '0755' './rustdesk-server/DEBIAN/prerm' /usr/bin/chmod --verbose '0755' './rustdesk-server/etc/init.d/rustdesk-hbbr' /usr/bin/chmod --verbose '0755' './rustdesk-server/etc/init.d/rustdesk-hbbs' /usr/bin/chmod --verbose '0640' './rustdesk-server/etc/rustdesk/relay.conf' /usr/bin/chmod --verbose '0640' './rustdesk-server/etc/rustdesk/signal.conf' /usr/bin/install --directory --verbose './rustdesk-server/usr/bin' /usr/bin/mv --verbose './sources/${{ matrix.binary }}/rustdesk-utils' './rustdesk-server/usr/bin' /usr/bin/install --directory --verbose './rustdesk-server/usr/sbin' /usr/bin/mv --verbose './sources/${{ matrix.binary }}/hbbr' './rustdesk-server/usr/sbin' /usr/bin/mv --verbose './sources/${{ matrix.binary }}/hbbs' './rustdesk-server/usr/sbin' - name: Debian Package [Generate] run: | /usr/bin/dpkg-gen './rustdesk-server' /usr/bin/mv --verbose './rustdesk-server.deb' './rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' - name: Release Debian Package [Configuration] run: | /usr/bin/echo '${{ secrets.REPOSITORY_SSH_PRIVATE_KEY }}' > './id_ed25519' /usr/bin/chmod --quiet '0400' './id_ed25519' /usr/bin/echo "REPOSITORY_CODENAME='${{ matrix.codename }}'" > './rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' /usr/bin/echo "Set Configuration 'REPOSITORY_CODENAME' to '${{ matrix.codename }}'" /usr/bin/echo "REPOSITORY_COMPONENT='${{ matrix.component }}'" >> './rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' /usr/bin/echo "Set Configuration 'REPOSITORY_COMPONENT' to '${{ matrix.component }}'" - name: Release Debian Package [PrivLab Repository] uses: https://gitea.com/actions/gitea-release-action@v1 with: name: Rustdesk Server v${{ steps.environment.outputs.version }} tag_name: v${{ steps.environment.outputs.version }} files: | rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb - name: Release Debian Package [Advanced Package Tool Repository] run: | /usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" './rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' '${{ secrets.REPOSITORY_SSH_USER }}'@'${{ secrets.REPOSITORY_SSH_HOSTNAME }}':'${{ secrets.REPOSITORY_DESTINATION }}/rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.deb' /usr/bin/scp -4 -B -C -i './id_ed25519' -o 'LogLevel QUIET' -o 'StrictHostKeyChecking no' -o "UserKnownHostsFile '/dev/null'" './rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg' '${{ secrets.REPOSITORY_SSH_USER }}'@'${{ secrets.REPOSITORY_SSH_HOSTNAME }}':'${{ secrets.REPOSITORY_DESTINATION }}/rustdesk-server_${{ steps.environment.outputs.version }}_${{ matrix.architecture }}.cfg'