diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cb6793..5398785 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,8 +103,8 @@ jobs: - { platform: "amd64", goos: "linux", docker_platform: "linux/amd64" } - { platform: "arm64v8", goos: "linux", docker_platform: "linux/arm64" } steps: -# - name: Checkout code -# uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/login-action@v2 @@ -120,11 +120,12 @@ jobs: uses: actions/download-artifact@v3 with: name: rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }} - path: rustdesk-api/ + path: ./ - name: Unzip binaries run: | - tar -xzf rustdesk-api/rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C rustdesk-api/ + mkdir release -p + tar -xzf rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C release/ - name: Build and push Docker image uses: docker/build-push-action@v5 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index f60b528..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Push Docker Image - -on: - push: - tags: - - 'v*.*.*' # 仅当推送标签(例如 v1.0.0)时触发 - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - - - - name: Extract version from tag - id: vars - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile - push: true - tags: lejianwen/rustdesk-api:latest, lejianwen/rustdesk-api:${{ env.TAG }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 1546bd6..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,27 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go - -on: - pull_request: - branches: [ "master" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22' - - name: mod tidy - run: go mod tidy - - name: Build - run: go build -v -o release/apimain cmd/apimain.go - - - name: Test - run: go test -v cmd/apimain.go diff --git a/Dockerfile b/Dockerfile index 835b5cc..6181de2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM golang:1.22-alpine as builder FROM alpine WORKDIR /app RUN apk add --no-cache tzdata -COPY rustdesk-api/release /app/ +COPY ./release /app/ VOLUME /app/data EXPOSE 21114