Просмотр исходного кода

test windows build

win build action

win build action

win build action

win build action

win build action

win build action

win build action

win build action

win build action

win build action

win build action
Paolo Asperti лет назад: 3
Родитель
Сommit
f626f82a94
1 измененных файлов с 57 добавлено и 19 удалено
  1. 57 19
      .github/workflows/build.yaml

+ 57 - 19
.github/workflows/build.yaml

@@ -44,9 +44,11 @@ jobs:
44 44
       - name: Install toolchain
45 45
         uses: actions-rs/toolchain@v1
46 46
         with:
47
-          toolchain: nightly
47
+          toolchain: "1.62"
48 48
           override: true
49 49
           default: true
50
+          components: rustfmt
51
+          profile: minimal
50 52
           target: ${{ matrix.job.target }}
51 53
 
52 54
       - name: Build
@@ -56,59 +58,95 @@ jobs:
56 58
           args: --release --all-features --target=${{ matrix.job.target }}
57 59
           use-cross: true  
58 60
 
59
-      # - name: Run tests
60
-      #   run: cargo test --verbose
61
-
62 61
       - name: Exec chmod
63 62
         run: chmod -v a+x target/${{ matrix.job.target }}/release/*
64 63
 
65 64
       - name: Publish Artifacts
66 65
         uses: actions/upload-artifact@v3
67 66
         with:
68
-          name: binaries-${{ matrix.job.name }}
67
+          name: binaries-linux-${{ matrix.job.name }}
69 68
           path: |
70 69
             target/${{ matrix.job.target }}/release/hbbr
71 70
             target/${{ matrix.job.target }}/release/hbbs
72 71
             target/${{ matrix.job.target }}/release/rustdesk-utils
73 72
           if-no-files-found: error
74 73
 
74
+  build-win:
75
+    name: Build - windows
76
+    runs-on: windows-2019
77
+
78
+    steps:
79
+      
80
+      - name: Checkout
81
+        uses: actions/checkout@v3
82
+
83
+      - name: Install toolchain
84
+        uses: actions-rs/toolchain@v1
85
+        with:
86
+          toolchain: "1.62"
87
+          override: true
88
+          default: true
89
+          components: rustfmt
90
+          profile: minimal
91
+          target: x86_64-pc-windows-msvc
92
+
93
+      - name: Build
94
+        uses: actions-rs/cargo@v1
95
+        with:
96
+          command: build
97
+          args: --release --all-features --target=x86_64-pc-windows-msvc
98
+          use-cross: true  
99
+
100
+      - name: Publish Artifacts
101
+        uses: actions/upload-artifact@v3
102
+        with:
103
+          name: binaries-windows-x86_64
104
+          path: |
105
+            target\x86_64-pc-windows-msvc\release\hbbr.exe
106
+            target\x86_64-pc-windows-msvc\release\hbbs.exe
107
+            target\x86_64-pc-windows-msvc\release\rustdesk-utils.exe 
108
+          if-no-files-found: error
109
+
75 110
   # github (draft) release with all binaries
76 111
   release:
77 112
 
78 113
     name: Github release
79
-    needs: build
114
+    needs: 
115
+      - build
116
+      - build-win
80 117
     runs-on: ubuntu-22.04
81 118
     strategy:
82 119
       fail-fast: false
83 120
       matrix:
84 121
         job:
85
-          - { name: "amd64" }
86
-          - { name: "arm64v8" }
87
-          - { name: "armv7" }
88
-          - { name: "i386" }
122
+          - { os: "linux", name: "amd64" }
123
+          - { os: "linux", name: "arm64v8" }
124
+          - { os: "linux", name: "armv7" }
125
+          - { os: "linux", name: "i386" }
126
+          - { os: "windows", name: "x86_64" }
89 127
 
90 128
     steps:
91 129
 
92
-      - name: Download binaries (${{ matrix.job.name }})
130
+      - name: Download binaries (${{ matrix.job.os }} - ${{ matrix.job.name }})
93 131
         uses: actions/download-artifact@v3
94 132
         with:
95
-          name: binaries-${{ matrix.job.name }}
133
+          name: binaries-${{ matrix.job.os }}-${{ matrix.job.name }}
96 134
           path: ${{ matrix.job.name }}
97 135
 
98 136
       - name: Exec chmod
99 137
         run: chmod -v a+x ${{ matrix.job.name }}/*
100 138
 
101
-      - name: Pack files (${{ matrix.job.name }})
139
+      - name: Pack files (${{ matrix.job.os }} - ${{ matrix.job.name }})
102 140
         run: |
103 141
           sudo apt update
104 142
           DEBIAN_FRONTEND=noninteractive sudo apt install -y zip
105
-          zip ${{ matrix.job.name }}/rustdesk-server-linux-${{ matrix.job.name }}.zip ${{ matrix.job.name }}/hbbr ${{ matrix.job.name }}/hbbs ${{ matrix.job.name }}/rustdesk-utils
143
+          zip ${{ matrix.job.name }}/rustdesk-server-${{ matrix.job.os }}-${{ matrix.job.name }}.zip ${{ matrix.job.name }}/*
106 144
 
107
-      - name: Create Release (${{ matrix.job.name }})
145
+      - name: Create Release (${{ matrix.job.os }} - (${{ matrix.job.name }})
108 146
         uses: softprops/action-gh-release@v1
109 147
         with:
110 148
           draft: true
111
-          files: ${{ matrix.job.name }}/rustdesk-server-linux-${{ matrix.job.name }}.zip
149
+          files: ${{ matrix.job.name }}/rustdesk-server-${{ matrix.job.os }}-${{ matrix.job.name }}.zip
112 150
             
113 151
   # docker build and push of single-arch images
114 152
   docker:
@@ -133,7 +171,7 @@ jobs:
133 171
       - name: Download binaries
134 172
         uses: actions/download-artifact@v3
135 173
         with:
136
-          name: binaries-${{ matrix.job.name }}
174
+          name: binaries-linux-${{ matrix.job.name }}
137 175
           path: docker/rootfs/usr/bin
138 176
 
139 177
       - name: Make binaries executable
@@ -253,7 +291,7 @@ jobs:
253 291
       - name: Download binaries
254 292
         uses: actions/download-artifact@v3
255 293
         with:
256
-          name: binaries-${{ matrix.job.name }}
294
+          name: binaries-linux-${{ matrix.job.name }}
257 295
           path: docker-classic/
258 296
 
259 297
       - name: Make binaries executable
@@ -320,7 +358,7 @@ jobs:
320 358
       - name: Download binaries
321 359
         uses: actions/download-artifact@v3
322 360
         with:
323
-          name: binaries-${{ matrix.job.name }}
361
+          name: binaries-linux-${{ matrix.job.name }}
324 362
           path: debian-build/${{ matrix.job.name }}/bin
325 363
 
326 364
       - name: Build package for ${{ matrix.job.name }} arch