1
+ name : QMake Build Matrix
2
+
3
+ on : [push]
4
+
5
+ env :
6
+ QT_VERSION : 6.8.0
7
+
8
+ jobs :
9
+ build :
10
+ name : ${{ matrix.config.name }}
11
+ runs-on : ${{ matrix.config.os }}
12
+ strategy :
13
+ matrix :
14
+ config :
15
+ # - {
16
+ # name: "Windows Latest x64",
17
+ # artifact: "Windows-x64.zip",
18
+ # arch: win64_msvc2022_64,
19
+ # os: windows-latest,
20
+ # environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
21
+ # }
22
+ - {
23
+ name : " Linux Latest x64" ,
24
+ artifact : " Linux-x64.zip" ,
25
+ arch : " " ,
26
+ os : ubuntu-latest
27
+ }
28
+ # - {
29
+ # name: "macOS Latest x64",
30
+ # artifact: "macOS-x64.zip",
31
+ # arch: "",
32
+ # os: macos-latest
33
+ # }
34
+
35
+ steps :
36
+ - uses : actions/checkout@v1
37
+
38
+ - name : Installing system libs on Ubuntu
39
+ # if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
40
+ shell : cmake -P {0}
41
+ run : |
42
+ if ("${{ runner.os }}" STREQUAL "Linux")
43
+ execute_process(
44
+ COMMAND sudo apt install libusb-1.0-0-dev libhidapi-dev
45
+ )
46
+ endif()
47
+
48
+ - name : Download Qt
49
+ id : qt
50
+ uses : jurplel/install-qt-action@v4
51
+ with :
52
+ version : " ${{ env.QT_VERSION }}"
53
+ arch : " ${{ matrix.config.arch }}"
54
+
55
+ - name : Configure
56
+ run : |
57
+ cmake -S . -B ./build
58
+
59
+ - name : Build
60
+ run : |
61
+ cd ./build
62
+ make -j $(nproc)
63
+
64
+ - uses : actions/upload-artifact@v4
65
+ id : upload_artifact
66
+ with :
67
+ path : ./qtusb-${{ matrix.config.artifact }}
68
+ name : qtusb-${{ matrix.config.artifact }}
69
+
70
+ release :
71
+ if : contains(github.ref, 'tags/v')
72
+ runs-on : ubuntu-latest
73
+ needs : build
74
+
75
+ steps :
76
+ - name : Create Release
77
+ id : create_release
78
+
79
+ env :
80
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81
+ with :
82
+ tag_name : ${{ github.ref }}
83
+ release_name : Release ${{ github.ref }}
84
+ draft : false
85
+ prerelease : false
86
+
87
+ - name : Store Release url
88
+ run : |
89
+ echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
90
+
91
+ - uses : actions/upload-artifact@v1
92
+ with :
93
+ path : ./upload_url
94
+ name : upload_url
95
+
96
+ publish :
97
+ if : contains(github.ref, 'tags/v')
98
+
99
+ name : ${{ matrix.config.name }}
100
+ runs-on : ${{ matrix.config.os }}
101
+ strategy :
102
+ matrix :
103
+ config :
104
+ # - {
105
+ # name: "Windows Latest x64",
106
+ # artifact: "Windows-x64.zip",
107
+ # os: windows-latest
108
+ # }
109
+ - {
110
+ name : " Linux Latest x64" ,
111
+ artifact : " Linux-x64.zip" ,
112
+ os : ubuntu-latest
113
+ }
114
+ # - {
115
+ # name: "macOS Latest x64",
116
+ # artifact: "macOS-x64.zip",
117
+ # os: macos-latest
118
+ # }
119
+ needs : release
120
+
121
+ steps :
122
+ - name : Download artifact
123
+ uses : actions/download-artifact@v1
124
+ with :
125
+ name : ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }}
126
+ path : ./
127
+
128
+ - name : Download URL
129
+ uses : actions/download-artifact@v1
130
+ with :
131
+ name : upload_url
132
+ path : ./
133
+ - id : set_upload_url
134
+ run : |
135
+ upload_url=`cat ./upload_url`
136
+ echo ::set-output name=upload_url::$upload_url
137
+
138
+ - name : Upload to Release
139
+ id : upload_to_release
140
+
141
+ env :
142
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
143
+ with :
144
+ upload_url : ${{ steps.set_upload_url.outputs.upload_url }}
145
+ asset_path : ./qtusb-${{ matrix.config.artifact }}
146
+ asset_name : qtusb}-${{ matrix.config.artifact }}
147
+ asset_content_type : application/zip
0 commit comments