Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061824c466 | ||
|
|
a9d20a082e | ||
|
|
69dfa1015e | ||
|
|
eaaca6cffd | ||
|
|
fb8b5b9cf4 | ||
|
|
f85f6910d2 |
@@ -1,182 +0,0 @@
|
|||||||
name: build-test
|
|
||||||
|
|
||||||
# ------------- NOTE
|
|
||||||
# please setup some secrets before running this workflow:
|
|
||||||
# DOCKER_IMAGE should be the target image name on docker hub (e.g. "rustdesk/rustdesk-server-s6" )
|
|
||||||
# DOCKER_IMAGE_CLASSIC should be the target image name on docker hub for the old build (e.g. "rustdesk/rustdesk-server" )
|
|
||||||
# DOCKER_USERNAME is the username you normally use to login at https://hub.docker.com/
|
|
||||||
# DOCKER_PASSWORD is a token you should create under "account settings / security" with read/write access
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'test.*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
LATEST_TAG: latest
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# binary build
|
|
||||||
build:
|
|
||||||
|
|
||||||
name: Build - ${{ matrix.job.name }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", target: "x86_64-unknown-linux-musl" }
|
|
||||||
- { name: "arm64v8", target: "aarch64-unknown-linux-musl" }
|
|
||||||
- { name: "armv7", target: "armv7-unknown-linux-musleabihf" }
|
|
||||||
- { name: "i386", target: "i686-unknown-linux-musl" }
|
|
||||||
#- { name: "amd64fb", target: "x86_64-unknown-freebsd" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install toolchain
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
default: true
|
|
||||||
components: rustfmt
|
|
||||||
profile: minimal
|
|
||||||
target: ${{ matrix.job.target }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release --all-features --target=${{ matrix.job.target }}
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
- name: Exec chmod
|
|
||||||
run: chmod -v a+x target/${{ matrix.job.target }}/release/*
|
|
||||||
|
|
||||||
- name: Publish Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: |
|
|
||||||
target/${{ matrix.job.target }}/release/hbbr
|
|
||||||
target/${{ matrix.job.target }}/release/hbbs
|
|
||||||
target/${{ matrix.job.target }}/release/rustdesk-utils
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
|
|
||||||
# docker build and push of single-arch images
|
|
||||||
docker:
|
|
||||||
|
|
||||||
name: Docker push - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", docker_platform: "linux/amd64", s6_platform: "x86_64" }
|
|
||||||
- { name: "arm64v8", docker_platform: "linux/arm64", s6_platform: "aarch64" }
|
|
||||||
- { name: "armv7", docker_platform: "linux/arm/v7", s6_platform: "armhf" }
|
|
||||||
# - { name: "i386", docker_platform: "linux/386", s6_platform: "i686" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: docker/rootfs/usr/bin
|
|
||||||
|
|
||||||
- name: Make binaries executable
|
|
||||||
run: chmod -v a+x docker/rootfs/usr/bin/*
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: "./docker"
|
|
||||||
platforms: ${{ matrix.job.docker_platform }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
build-args: |
|
|
||||||
S6_ARCH=${{ matrix.job.s6_platform }}
|
|
||||||
tags: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# docker build and push of multiarch images
|
|
||||||
docker-manifest:
|
|
||||||
|
|
||||||
name: Docker manifest s6
|
|
||||||
needs: docker
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# manifest for :1.2.3 tag
|
|
||||||
# this has to run only if invoked by a new tag
|
|
||||||
- name: Create and push manifest (:ve.rs.ion)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}
|
|
||||||
inputs: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-amd64,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-arm64v8,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-armv7,
|
|
||||||
# ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
@@ -1,517 +0,0 @@
|
|||||||
name: build
|
|
||||||
|
|
||||||
# ------------- NOTE
|
|
||||||
# please setup some secrets before running this workflow:
|
|
||||||
# DOCKER_IMAGE should be the target image name on docker hub (e.g. "rustdesk/rustdesk-server-s6" )
|
|
||||||
# DOCKER_IMAGE_CLASSIC should be the target image name on docker hub for the old build (e.g. "rustdesk/rustdesk-server" )
|
|
||||||
# DOCKER_USERNAME is the username you normally use to login at https://hub.docker.com/
|
|
||||||
# DOCKER_PASSWORD is a token you should create under "account settings / security" with read/write access
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+'
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+'
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
LATEST_TAG: latest
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# binary build
|
|
||||||
build:
|
|
||||||
|
|
||||||
name: Build - ${{ matrix.job.name }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", target: "x86_64-unknown-linux-musl" }
|
|
||||||
- { name: "arm64v8", target: "aarch64-unknown-linux-musl" }
|
|
||||||
- { name: "armv7", target: "armv7-unknown-linux-musleabihf" }
|
|
||||||
- { name: "i386", target: "i686-unknown-linux-musl" }
|
|
||||||
#- { name: "amd64fb", target: "x86_64-unknown-freebsd" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install toolchain
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
default: true
|
|
||||||
components: rustfmt
|
|
||||||
profile: minimal
|
|
||||||
target: ${{ matrix.job.target }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release --all-features --target=${{ matrix.job.target }}
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
- name: Exec chmod
|
|
||||||
run: chmod -v a+x target/${{ matrix.job.target }}/release/*
|
|
||||||
|
|
||||||
- name: Publish Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: |
|
|
||||||
target/${{ matrix.job.target }}/release/hbbr
|
|
||||||
target/${{ matrix.job.target }}/release/hbbs
|
|
||||||
target/${{ matrix.job.target }}/release/rustdesk-utils
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
build-win:
|
|
||||||
name: Build - windows
|
|
||||||
runs-on: windows-2022
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install toolchain
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
default: true
|
|
||||||
components: rustfmt
|
|
||||||
profile: minimal
|
|
||||||
target: x86_64-pc-windows-msvc
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release --all-features --target=x86_64-pc-windows-msvc
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
- name: Install NSIS
|
|
||||||
run: |
|
|
||||||
iwr -useb get.scoop.sh -outfile 'install.ps1'
|
|
||||||
.\install.ps1 -RunAsAdmin
|
|
||||||
scoop update
|
|
||||||
scoop bucket add extras
|
|
||||||
scoop install nsis
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 16
|
|
||||||
|
|
||||||
- name: Sign exe files
|
|
||||||
uses: GermanBluefox/code-sign-action@v7
|
|
||||||
if: false
|
|
||||||
with:
|
|
||||||
certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}'
|
|
||||||
password: '${{ secrets.WINDOWS_PFX_PASSWORD }}'
|
|
||||||
certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}'
|
|
||||||
folder: 'target\x86_64-pc-windows-msvc\release'
|
|
||||||
recursive: false
|
|
||||||
|
|
||||||
- name: Build UI browser file
|
|
||||||
run: |
|
|
||||||
npm i
|
|
||||||
npm run build
|
|
||||||
working-directory: ./ui/html
|
|
||||||
|
|
||||||
- name: Build UI setup file
|
|
||||||
run: |
|
|
||||||
rustup default nightly
|
|
||||||
cargo build --release
|
|
||||||
xcopy /y ..\target\x86_64-pc-windows-msvc\release\*.exe setup\bin\
|
|
||||||
xcopy /y target\release\*.exe setup\
|
|
||||||
mkdir setup\logs
|
|
||||||
makensis /V1 setup.nsi
|
|
||||||
mkdir SignOutput
|
|
||||||
mv RustDeskServer.Setup.exe SignOutput\
|
|
||||||
mv ..\target\x86_64-pc-windows-msvc\release\*.exe SignOutput\
|
|
||||||
working-directory: ./ui
|
|
||||||
|
|
||||||
- name: Sign UI setup file
|
|
||||||
uses: GermanBluefox/code-sign-action@v7
|
|
||||||
if: false
|
|
||||||
with:
|
|
||||||
certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}'
|
|
||||||
password: '${{ secrets.WINDOWS_PFX_PASSWORD }}'
|
|
||||||
certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}'
|
|
||||||
folder: './ui/SignOutput'
|
|
||||||
recursive: false
|
|
||||||
|
|
||||||
- name: Publish Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-windows-x86_64
|
|
||||||
path: |
|
|
||||||
ui\SignOutput\hbbr.exe
|
|
||||||
ui\SignOutput\hbbs.exe
|
|
||||||
ui\SignOutput\rustdesk-utils.exe
|
|
||||||
ui\SignOutput\RustDeskServer.Setup.exe
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
# github (draft) release with all binaries
|
|
||||||
release:
|
|
||||||
|
|
||||||
name: Github release
|
|
||||||
needs:
|
|
||||||
- build
|
|
||||||
- build-win
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { os: "linux", name: "amd64", suffix: "" }
|
|
||||||
- { os: "linux", name: "arm64v8", suffix: "" }
|
|
||||||
- { os: "linux", name: "armv7", suffix: "" }
|
|
||||||
- { os: "linux", name: "i386", suffix: "" }
|
|
||||||
#- { os: "linux", name: "amd64fb", suffix: "" }
|
|
||||||
- { os: "windows", name: "x86_64", suffix: "-unsigned" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Download binaries (${{ matrix.job.os }} - ${{ matrix.job.name }})
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-${{ matrix.job.os }}-${{ matrix.job.name }}
|
|
||||||
path: ${{ matrix.job.name }}
|
|
||||||
|
|
||||||
- name: Exec chmod
|
|
||||||
run: chmod -v a+x ${{ matrix.job.name }}/*
|
|
||||||
|
|
||||||
- name: Pack files (${{ matrix.job.os }} - ${{ matrix.job.name }})
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt install -y zip
|
|
||||||
zip ${{ matrix.job.name }}/rustdesk-server-${{ matrix.job.os }}-${{ matrix.job.name }}${{ matrix.job.suffix }}.zip ${{ matrix.job.name }}/*
|
|
||||||
|
|
||||||
- name: Create Release (${{ matrix.job.os }} - (${{ matrix.job.name }})
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: ${{ matrix.job.name }}/rustdesk-server-${{ matrix.job.os }}-${{ matrix.job.name }}${{ matrix.job.suffix }}.zip
|
|
||||||
|
|
||||||
# docker build and push of single-arch images
|
|
||||||
docker:
|
|
||||||
|
|
||||||
name: Docker push - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", docker_platform: "linux/amd64", s6_platform: "x86_64" }
|
|
||||||
- { name: "arm64v8", docker_platform: "linux/arm64", s6_platform: "aarch64" }
|
|
||||||
- { name: "armv7", docker_platform: "linux/arm/v7", s6_platform: "armhf" }
|
|
||||||
# - { name: "i386", docker_platform: "linux/386", s6_platform: "i686" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: docker/rootfs/usr/bin
|
|
||||||
|
|
||||||
- name: Make binaries executable
|
|
||||||
run: chmod -v a+x docker/rootfs/usr/bin/*
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: "./docker"
|
|
||||||
platforms: ${{ matrix.job.docker_platform }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
build-args: |
|
|
||||||
S6_ARCH=${{ matrix.job.s6_platform }}
|
|
||||||
tags: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-${{ matrix.job.name }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# docker build and push of multiarch images
|
|
||||||
docker-manifest:
|
|
||||||
|
|
||||||
name: Docker manifest s6
|
|
||||||
needs: docker
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# manifest for :1.2.3 tag
|
|
||||||
# this has to run only if invoked by a new tag
|
|
||||||
- name: Create and push manifest (:ve.rs.ion)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}
|
|
||||||
inputs: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-amd64,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-arm64v8,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-armv7,
|
|
||||||
# ${{ secrets.DOCKER_IMAGE }}:${{ env.GIT_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# manifest for :1 tag (major release)
|
|
||||||
- name: Create and push manifest (:major)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}
|
|
||||||
inputs: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-amd64,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-arm64v8,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-armv7,
|
|
||||||
# ${{ secrets.DOCKER_IMAGE }}:${{ env.MAJOR_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# manifest for :latest tag
|
|
||||||
- name: Create and push manifest (:latest)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}
|
|
||||||
inputs: |
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-amd64,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-arm64v8,
|
|
||||||
${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-armv7,
|
|
||||||
# ${{ secrets.DOCKER_IMAGE }}:${{ env.LATEST_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
|
|
||||||
# docker build and push of single-arch images
|
|
||||||
docker-classic:
|
|
||||||
|
|
||||||
name: Docker push classic - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", docker_platform: "linux/amd64" }
|
|
||||||
- { name: "arm64v8", docker_platform: "linux/arm64" }
|
|
||||||
- { name: "armv7", docker_platform: "linux/arm/v7" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: docker-classic/
|
|
||||||
|
|
||||||
- name: Make binaries executable
|
|
||||||
run: chmod -v a+x docker-classic/*
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v4
|
|
||||||
with:
|
|
||||||
images: registry.hub.docker.com/${{ secrets.DOCKER_IMAGE_CLASSIC }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: "./docker-classic"
|
|
||||||
platforms: ${{ matrix.job.docker_platform }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
tags: |
|
|
||||||
${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
|
|
||||||
${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
||||||
${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-${{ matrix.job.name }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# docker build and push of multiarch images
|
|
||||||
docker-manifest-classic:
|
|
||||||
|
|
||||||
name: Docker manifest classic
|
|
||||||
needs: docker
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# manifest for :1.2.3 tag
|
|
||||||
# this has to run only if invoked by a new tag
|
|
||||||
- name: Create and push manifest (:ve.rs.ion)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}
|
|
||||||
inputs: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.GIT_TAG }}-armv7
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# manifest for :1 tag (major release)
|
|
||||||
- name: Create and push manifest (:major)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}
|
|
||||||
inputs: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.MAJOR_TAG }}-armv7
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# manifest for :latest tag
|
|
||||||
- name: Create and push manifest (:latest)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}
|
|
||||||
inputs: ${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-amd64,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-arm64v8,${{ secrets.DOCKER_IMAGE_CLASSIC }}:${{ env.LATEST_TAG }}-armv7
|
|
||||||
push: true
|
|
||||||
|
|
||||||
|
|
||||||
deb-package:
|
|
||||||
|
|
||||||
name: debian package - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", debian_platform: "amd64", crossbuild_package: "" }
|
|
||||||
- { name: "arm64v8", debian_platform: "arm64", crossbuild_package: "crossbuild-essential-arm64" }
|
|
||||||
- { name: "armv7", debian_platform: "armhf", crossbuild_package: "crossbuild-essential-armhf" }
|
|
||||||
- { name: "i386", debian_platform: "i386", crossbuild_package: "crossbuild-essential-i386" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
|
|
||||||
- name: Create packaging env
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt install -y devscripts build-essential debhelper pkg-config ${{ matrix.job.crossbuild_package }}
|
|
||||||
mkdir -p debian-build/${{ matrix.job.name }}/bin
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: debian-build/${{ matrix.job.name }}/bin
|
|
||||||
|
|
||||||
- name: Build package for ${{ matrix.job.name }} arch
|
|
||||||
run: |
|
|
||||||
chmod -v a+x debian-build/${{ matrix.job.name }}/bin/*
|
|
||||||
cp -vr debian systemd debian-build/${{ matrix.job.name }}/
|
|
||||||
cat debian/control.tpl | sed 's/{{ ARCH }}/${{ matrix.job.debian_platform }}/' > debian-build/${{ matrix.job.name }}/debian/control
|
|
||||||
cd debian-build/${{ matrix.job.name }}/
|
|
||||||
debuild -i -us -uc -b -a${{ matrix.job.debian_platform }}
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
files: |
|
|
||||||
debian-build/rustdesk-server-hbbr_*_${{ matrix.job.debian_platform }}.deb
|
|
||||||
debian-build/rustdesk-server-hbbs_*_${{ matrix.job.debian_platform }}.deb
|
|
||||||
debian-build/rustdesk-server-utils_*_${{ matrix.job.debian_platform }}.deb
|
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
name: CI and Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- forapi
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
- forapi
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
name: Cargo Check
|
||||||
|
runs-on: ubuntu
|
||||||
|
container:
|
||||||
|
# Cargo.lock v4 需要 Cargo >= 1.78;依赖 MSRV 要求 >= 1.89
|
||||||
|
image: rust:1.90
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout and check
|
||||||
|
run: |
|
||||||
|
cd /tmp
|
||||||
|
git clone --depth=1 -b ${{ github.ref_name }} https://admin:${{ secrets.TOKEN }}@git.viaeon.com/admin/rustdesk-server.git repo
|
||||||
|
cd repo
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git submodule update --init --recursive
|
||||||
|
cargo check --all-features
|
||||||
|
|
||||||
|
docker:
|
||||||
|
name: Build and Push Docker Image
|
||||||
|
runs-on: ubuntu
|
||||||
|
needs: [check]
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Docker CLI
|
||||||
|
run: |
|
||||||
|
if ! command -v docker &> /dev/null; then
|
||||||
|
if command -v apk &> /dev/null; then
|
||||||
|
apk add --no-cache docker-cli
|
||||||
|
elif command -v apt-get &> /dev/null; then
|
||||||
|
apt-get update && apt-get install -y docker.io
|
||||||
|
else
|
||||||
|
curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-24.0.7.tgz | tar xz -C /tmp
|
||||||
|
mv /tmp/docker/docker /usr/local/bin/
|
||||||
|
chmod +x /usr/local/bin/docker
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
docker --version
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Login to Gitea Container Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.TOKEN }}" | docker login git.viaeon.com -u "${{ github.actor }}" --password-stdin 2>&1
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
echo "Building image..."
|
||||||
|
docker build \
|
||||||
|
--label "org.opencontainers.image.source=https://git.viaeon.com/admin/rustdesk-server" \
|
||||||
|
--label "org.opencontainers.image.revision=${{ github.sha }}" \
|
||||||
|
-f Dockerfile.ci \
|
||||||
|
-t git.viaeon.com/admin/rustdesk-server:${{ github.ref_name }} \
|
||||||
|
-t git.viaeon.com/admin/rustdesk-server:latest . 2>&1
|
||||||
|
|
||||||
|
- name: Push Docker image
|
||||||
|
run: |
|
||||||
|
echo "Pushing ${{ github.ref_name }}..."
|
||||||
|
docker push git.viaeon.com/admin/rustdesk-server:${{ github.ref_name }} 2>&1
|
||||||
|
echo "Pushing latest..."
|
||||||
|
docker push git.viaeon.com/admin/rustdesk-server:latest 2>&1
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy to Remote Server
|
||||||
|
runs-on: ubuntu
|
||||||
|
needs: docker
|
||||||
|
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/forapi')
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install SSH Client
|
||||||
|
run: |
|
||||||
|
if command -v apk &> /dev/null; then
|
||||||
|
apk add --no-cache openssh-client sshpass
|
||||||
|
elif command -v apt-get &> /dev/null; then
|
||||||
|
apt-get update && apt-get install -y openssh-client sshpass
|
||||||
|
else
|
||||||
|
echo "Cannot install sshpass"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
ssh -V
|
||||||
|
|
||||||
|
- name: Deploy via SSH
|
||||||
|
run: |
|
||||||
|
sshpass -p '${{ secrets.DEPLOY_PASSWORD }}' ssh -o StrictHostKeyChecking=no -p ${{ secrets.DEPLOY_PORT || '22' }} ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << ENDSSH
|
||||||
|
set -e
|
||||||
|
cd "${{ secrets.DEPLOY_PATH }}"
|
||||||
|
echo "Current directory: \$(pwd)"
|
||||||
|
echo "Pulling latest image..."
|
||||||
|
docker pull git.viaeon.com/admin/rustdesk-server:latest
|
||||||
|
echo "Restarting containers..."
|
||||||
|
docker compose down || true
|
||||||
|
docker compose up -d
|
||||||
|
echo "Cleaning up old images..."
|
||||||
|
docker image prune -f
|
||||||
|
echo "Deployment completed!"
|
||||||
|
ENDSSH
|
||||||
@@ -1,335 +0,0 @@
|
|||||||
name: Build and publish to ghcr.io
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+-[0-9]+'
|
|
||||||
- '[0-9]+.[0-9]+.[0-9]+-[0-9]+'
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
LATEST_TAG: latest
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write # So need to set "secrets.GITHUB_TOKEN"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
# Binary build
|
|
||||||
build:
|
|
||||||
name: Build - ${{ matrix.job.name }}
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", target: "x86_64-unknown-linux-musl" }
|
|
||||||
- { name: "arm64v8", target: "aarch64-unknown-linux-musl" }
|
|
||||||
- { name: "armv7", target: "armv7-unknown-linux-musleabihf" }
|
|
||||||
- { name: "i386", target: "i686-unknown-linux-musl" }
|
|
||||||
#- { name: "amd64fb", target: "x86_64-unknown-freebsd" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
|
||||||
uses: dtolnay/rust-toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
targets: ${{ matrix.job.target }}
|
|
||||||
components: "rustfmt"
|
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
with:
|
|
||||||
prefix-key: ${{ matrix.job.os }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
args: --release --all-features --target=${{ matrix.job.target }}
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
- name: Exec chmod
|
|
||||||
run: chmod -v a+x target/${{ matrix.job.target }}/release/*
|
|
||||||
|
|
||||||
- name: Publish Artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: |
|
|
||||||
target/${{ matrix.job.target }}/release/hbbr
|
|
||||||
target/${{ matrix.job.target }}/release/hbbs
|
|
||||||
target/${{ matrix.job.target }}/release/rustdesk-utils
|
|
||||||
if-no-files-found: error
|
|
||||||
|
|
||||||
# Build and push single-arch Docker images to ghcr.io
|
|
||||||
create-s6-overlay-images:
|
|
||||||
name: Docker push s6-overlay - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", docker_platform: "linux/amd64", s6_platform: "x86_64" }
|
|
||||||
- { name: "arm64v8", docker_platform: "linux/arm64", s6_platform: "aarch64" }
|
|
||||||
- { name: "armv7", docker_platform: "linux/arm/v7", s6_platform: "armhf" }
|
|
||||||
# - { name: "i386", docker_platform: "linux/386", s6_platform: "i686" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: docker/rootfs/usr/bin
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Make binaries executable
|
|
||||||
run: chmod -v a+x docker/rootfs/usr/bin/*
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ghcr.io/${{ github.repository }}-s6
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: "./docker"
|
|
||||||
platforms: ${{ matrix.job.docker_platform }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
build-args: |
|
|
||||||
S6_ARCH=${{ matrix.job.s6_platform }}
|
|
||||||
tags: |
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}-${{ matrix.job.name }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# Set up minifest and tag for pushed image
|
|
||||||
create-s6-overlay-images-manifest:
|
|
||||||
name: Manifest for s6-overlay images
|
|
||||||
needs: create-s6-overlay-images
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Create and push manifest for :ve.rs.ion tag
|
|
||||||
- name: Create and push manifest (:ve.rs.ion)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}-armv7,
|
|
||||||
# ghcr.io/${{ github.repository }}-s6:${{ env.GIT_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# Create and push manifest for :major tag
|
|
||||||
- name: Create and push manifest (:major)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}-armv7,
|
|
||||||
# ghcr.io/${{ github.repository }}-s6:${{ env.MAJOR_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# Create and push manifest for :latest tag
|
|
||||||
- name: Create and push manifest (:latest)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}-armv7,
|
|
||||||
# ghcr.io/${{ github.repository }}-s6:${{ env.LATEST_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# Build and push single-arch Docker images to ghcr.io
|
|
||||||
create-classic-images:
|
|
||||||
name: Docker push classic - ${{ matrix.job.name }}
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
job:
|
|
||||||
- { name: "amd64", docker_platform: "linux/amd64" }
|
|
||||||
- { name: "arm64v8", docker_platform: "linux/arm64" }
|
|
||||||
- { name: "armv7", docker_platform: "linux/arm/v7" }
|
|
||||||
- { name: "i386", docker_platform: "linux/386" }
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: binaries-linux-${{ matrix.job.name }}
|
|
||||||
path: docker-classic
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Make binaries executable
|
|
||||||
run: chmod -v a+x docker-classic/*
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ghcr.io/${{ github.repository }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: "./docker-classic"
|
|
||||||
platforms: ${{ matrix.job.docker_platform }}
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
tags: |
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}-${{ matrix.job.name }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
|
|
||||||
# Set up minifest and tag for pushed image
|
|
||||||
create-classic-images-manifest:
|
|
||||||
name: Manifest for classic images
|
|
||||||
needs: create-classic-images
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Log in to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Get git tag
|
|
||||||
id: vars
|
|
||||||
run: |
|
|
||||||
T=${GITHUB_REF#refs/*/}
|
|
||||||
M=${T%%.*}
|
|
||||||
echo "GIT_TAG=$T" >> $GITHUB_ENV
|
|
||||||
echo "MAJOR_TAG=$M" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Create and push manifest for :ve.rs.ion tag
|
|
||||||
- name: Create and push manifest (:ve.rs.ion)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
if: github.event_name != 'workflow_dispatch'
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}-armv7,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.GIT_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# Create and push manifest for :major tag
|
|
||||||
- name: Create and push manifest (:major)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}-armv7,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.MAJOR_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
|
|
||||||
# Create and push manifest for :latest tag
|
|
||||||
- name: Create and push manifest (:latest)
|
|
||||||
uses: Noelware/docker-manifest-action@master
|
|
||||||
with:
|
|
||||||
tags: ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}
|
|
||||||
inputs: |
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}-amd64,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}-arm64v8,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}-armv7,
|
|
||||||
ghcr.io/${{ github.repository }}:${{ env.LATEST_TAG }}-i386
|
|
||||||
push: true
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
name: test
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
paths-ignore:
|
|
||||||
- '**/README.md'
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
paths-ignore:
|
|
||||||
- '**/README.md'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: check
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --all
|
|
||||||
|
|
||||||
fmt:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: build
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --all -- --check
|
|
||||||
|
|
||||||
clippy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: clippy
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
args: --all -- -D warnings
|
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
# 自建 Gitea CI 使用的镜像构建文件(对应官方 rustdesk/rustdesk-server-s6)
|
||||||
|
# 内容:s6-overlay + hbbs/hbbr/rustdesk-utils + apimain(API)一体
|
||||||
|
# 与官方 docker/Dockerfile 的区别:
|
||||||
|
# 1. 编译在构建阶段内完成(rust musl 静态链接),不依赖外部预编译产物
|
||||||
|
# 2. 底包换成自建的 git.viaeon.com/admin/rustdesk-api:latest,API 用的是你自己的构建
|
||||||
|
# 3. 保留 s6-overlay 与 key-secret 服务,因此 hbbs 会在首次启动时生成 /data/id_ed25519{,.pub}
|
||||||
|
# 4. 保留 api 服务,容器同时提供 21114 管理后台(不要再单独跑 rustdesk-api 容器)
|
||||||
|
#
|
||||||
|
# 构建(在仓库根目录执行,需要 .git 以拉取 submodule):
|
||||||
|
# docker build -f Dockerfile.ci -t git.viaeon.com/admin/rustdesk-server:latest .
|
||||||
|
|
||||||
|
# Cargo.lock 为 v4 格式需要 Cargo >= 1.78;依赖 uuid/idna_adapter 的 MSRV 要求 >= 1.89
|
||||||
|
FROM rust:1.90 AS builder
|
||||||
|
|
||||||
|
ARG TARGET=x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
build-essential \
|
||||||
|
musl-tools \
|
||||||
|
pkg-config \
|
||||||
|
ca-certificates \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& rustup target add ${TARGET}
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
COPY . /src
|
||||||
|
|
||||||
|
RUN git config --global --add safe.directory '*' \
|
||||||
|
&& git submodule update --init --recursive
|
||||||
|
|
||||||
|
RUN CC_x86_64_unknown_linux_musl=musl-gcc \
|
||||||
|
CARGO_NET_GIT_FETCH_WITH_CLI=true \
|
||||||
|
cargo build --release --all-features --target ${TARGET}
|
||||||
|
|
||||||
|
RUN mkdir -p /out \
|
||||||
|
&& cp target/${TARGET}/release/hbbs /out/hbbs \
|
||||||
|
&& cp target/${TARGET}/release/hbbr /out/hbbr \
|
||||||
|
&& cp target/${TARGET}/release/rustdesk-utils /out/rustdesk-utils
|
||||||
|
|
||||||
|
FROM git.viaeon.com/admin/rustdesk-api:latest
|
||||||
|
|
||||||
|
ARG S6_OVERLAY_VERSION=3.2.0.0
|
||||||
|
ARG S6_ARCH=x86_64
|
||||||
|
|
||||||
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
|
||||||
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz /tmp
|
||||||
|
|
||||||
|
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
|
||||||
|
&& tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz \
|
||||||
|
&& rm -f /tmp/s6-overlay*.tar.xz \
|
||||||
|
&& ln -s /run /var/run
|
||||||
|
|
||||||
|
COPY docker/rootfs/ /
|
||||||
|
|
||||||
|
COPY --from=builder /out/hbbs /usr/bin/hbbs
|
||||||
|
COPY --from=builder /out/hbbr /usr/bin/hbbr
|
||||||
|
COPY --from=builder /out/rustdesk-utils /usr/bin/rustdesk-utils
|
||||||
|
|
||||||
|
RUN chmod a+x /usr/bin/hbbs /usr/bin/hbbr /usr/bin/rustdesk-utils /usr/bin/healthcheck.sh \
|
||||||
|
&& echo "/package/admin/s6/command/s6-svstat /run/s6-rc/servicedirs/api || exit 1" >> /usr/bin/healthcheck.sh
|
||||||
|
|
||||||
|
ENV RELAY=relay.example.com
|
||||||
|
ENV ENCRYPTED_ONLY=0
|
||||||
|
|
||||||
|
VOLUME /data
|
||||||
|
VOLUME /app/data
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
EXPOSE 21114 21115 21116 21116/udp 21117 21118 21119
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=10s --timeout=5s CMD /usr/bin/healthcheck.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/init"]
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# 部署端使用的 compose(放到服务器的 DEPLOY_PATH 目录下)
|
||||||
|
# 该镜像为一体版:s6 同时跑 hbbs / hbbr / apimain,不要再单独起 rustdesk-api 容器
|
||||||
|
# 首次启动后从容器取公钥:docker exec rustdesk-server cat /data/id_ed25519.pub
|
||||||
|
# 管理后台:http://<服务器IP>:21114/_admin/
|
||||||
|
|
||||||
|
services:
|
||||||
|
rustdesk-server:
|
||||||
|
image: git.viaeon.com/admin/rustdesk-server:latest
|
||||||
|
container_name: rustdesk-server
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "21114:21114"
|
||||||
|
- "21115:21115"
|
||||||
|
- "21116:21116"
|
||||||
|
- "21116:21116/udp"
|
||||||
|
- "21117:21117"
|
||||||
|
- "21118:21118"
|
||||||
|
- "21119:21119"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./api-data:/app/data
|
||||||
|
environment:
|
||||||
|
# 改成你的服务器地址(客户端填的中继服务器)
|
||||||
|
RELAY: 你的域名或公网IP:21117
|
||||||
|
ENCRYPTED_ONLY: 0
|
||||||
|
# API 相关(按需调整)
|
||||||
|
# RUSTDESK_API_RUSTDESK_ID_SERVER: 你的域名或公网IP:21116
|
||||||
|
# RUSTDESK_API_RUSTDESK_RELAY_SERVER: 你的域名或公网IP:21117
|
||||||
|
# RUSTDESK_API_RUSTDESK_API_SERVER: http://你的域名或公网IP:21114
|
||||||
|
# 可选:固定密钥对,避免重建后 key 变化
|
||||||
|
# KEY_PUB: ""
|
||||||
|
# KEY_PRIV: ""
|
||||||
Reference in New Issue
Block a user