ljw 1 год назад
Родитель
Сommit
ca9a3155af
1 измененных файлов с 8 добавлено и 11 удалено
  1. 8 11
      .github/workflows/build.yml

+ 8 - 11
.github/workflows/build.yml

@@ -48,11 +48,10 @@ jobs:
48 48
       fail-fast: false
49 49
       matrix:
50 50
         job:
51
-          - { platform: "amd64", goos: "linux" }
52
-          - { platform: "arm64", goos: "linux" }
53
-          - { platform: "armv7l", goos: "linux" }
54
-          - { platform: "amd64", goos: "windows" }
55
-
51
+          - { platform: "amd64", goos: "linux", file_ext: "tar.gz" }
52
+          - { platform: "arm64", goos: "linux", file_ext: "tar.gz" }
53
+          - { platform: "armv7l", goos: "linux", file_ext: "tar.gz" }
54
+          - { platform: "amd64", goos: "windows", file_ext: "zip" }
56 55
     steps:
57 56
       - name: Checkout code
58 57
         uses: actions/checkout@v4
@@ -97,7 +96,7 @@ jobs:
97 96
           if [ "${{ matrix.job.goos }}" = "windows" ]; then
98 97
             sudo apt-get install gcc-mingw-w64-x86-64 zip -y
99 98
             GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=x86_64-w64-mingw32-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain.exe ./cmd/apimain.go
100
-            zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip ./release
99
+            zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
101 100
           else
102 101
             if [ "${{ matrix.job.platform }}" = "arm64" ]; then
103 102
                 wget https://musl.cc/aarch64-linux-musl-cross.tgz
@@ -113,7 +112,7 @@ jobs:
113 112
               sudo apt-get install musl musl-dev musl-tools -y
114 113
               GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
115 114
             fi
116
-            tar -czf ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz ./release
115
+            tar -czf ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
117 116
           fi
118 117
 
119 118
       - name: Upload artifact
@@ -121,14 +120,12 @@ jobs:
121 120
         with:
122 121
           name: rustdesk-api-${{ matrix.job.goos }}-${{ matrix.job.platform }}
123 122
           path: |
124
-            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz
125
-            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip
123
+            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}}
126 124
       - name: Upload to GitHub Release
127 125
         uses: softprops/action-gh-release@v2
128 126
         with:
129 127
           files: |
130
-            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.tar.gz
131
-            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.zip
128
+            ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}}
132 129
         #          tag_name: ${{ env.LATEST_TAG }}
133 130
         env:
134 131
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}