ljw 1 год назад
Родитель
Сommit
871bb328f0
4 измененных файлов с 6 добавлено и 70 удалено
  1. 5 4
      .github/workflows/build.yml
  2. 0 38
      .github/workflows/docker.yml
  3. 0 27
      .github/workflows/go.yml
  4. 1 1
      Dockerfile

+ 5 - 4
.github/workflows/build.yml

@@ -103,8 +103,8 @@ jobs:
103 103
           - { platform: "amd64", goos: "linux",  docker_platform: "linux/amd64" }
104 104
           - { platform: "arm64v8", goos: "linux",  docker_platform: "linux/arm64" }
105 105
     steps:
106
-#      - name: Checkout code
107
-#        uses: actions/checkout@v4
106
+      - name: Checkout code
107
+        uses: actions/checkout@v4
108 108
 
109 109
       - name: Log in to Docker Hub
110 110
         uses: docker/login-action@v2
@@ -120,11 +120,12 @@ jobs:
120 120
         uses: actions/download-artifact@v3
121 121
         with:
122 122
           name: rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}
123
-          path: rustdesk-api/
123
+          path: ./
124 124
 
125 125
       - name: Unzip binaries
126 126
         run: |
127
-          tar -xzf rustdesk-api/rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C rustdesk-api/
127
+          mkdir release -p
128
+          tar -xzf rustdesk-api-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C release/
128 129
 
129 130
       - name: Build and push Docker image
130 131
         uses: docker/build-push-action@v5

+ 0 - 38
.github/workflows/docker.yml

@@ -1,38 +0,0 @@
1
-name: Build and Push Docker Image
2
-
3
-on:
4
-  push:
5
-    tags:
6
-      - 'v*.*.*'  # 仅当推送标签(例如 v1.0.0)时触发
7
-
8
-jobs:
9
-  build:
10
-    runs-on: ubuntu-latest
11
-
12
-    steps:
13
-      - name: Checkout code
14
-        uses: actions/checkout@v4
15
-
16
-      - name: Set up Docker Buildx
17
-        uses: docker/setup-buildx-action@v3
18
-
19
-      - name: Log in to Docker Hub
20
-        uses: docker/login-action@v2
21
-        with:
22
-          username: ${{ secrets.DOCKER_USERNAME }}
23
-          password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
24
-
25
-
26
-
27
-      - name: Extract version from tag
28
-        id: vars
29
-        run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
30
-
31
-      - name: Build and push Docker image
32
-        id: push
33
-        uses: docker/build-push-action@v6
34
-        with:
35
-          context: .
36
-          file: ./Dockerfile
37
-          push: true
38
-          tags: lejianwen/rustdesk-api:latest, lejianwen/rustdesk-api:${{ env.TAG }}

+ 0 - 27
.github/workflows/go.yml

@@ -1,27 +0,0 @@
1
-# This workflow will build a golang project
2
-# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3
-
4
-name: Go
5
-
6
-on:
7
-  pull_request:
8
-    branches: [ "master" ]
9
-
10
-jobs:
11
-
12
-  build:
13
-    runs-on: ubuntu-latest
14
-    steps:
15
-    - uses: actions/checkout@v4
16
-
17
-    - name: Set up Go
18
-      uses: actions/setup-go@v4
19
-      with:
20
-        go-version: '1.22'
21
-    - name: mod tidy
22
-      run: go mod tidy
23
-    - name: Build
24
-      run: go build  -v -o release/apimain cmd/apimain.go
25
-
26
-    - name: Test
27
-      run: go test -v  cmd/apimain.go   

+ 1 - 1
Dockerfile

@@ -3,7 +3,7 @@ FROM golang:1.22-alpine as builder
3 3
 FROM alpine
4 4
 WORKDIR /app
5 5
 RUN apk add --no-cache tzdata
6
-COPY rustdesk-api/release /app/
6
+COPY ./release /app/
7 7
 VOLUME /app/data
8 8
 
9 9
 EXPOSE 21114