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 libusb-1.0-0-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
+ make
62
+
63
+ - uses : actions/upload-artifact@v4
64
+ id : upload_artifact
65
+ with :
66
+ path : ./qtusb-${{ matrix.config.artifact }}
67
+ name : qtusb-${{ matrix.config.artifact }}
68
+
69
+ release :
70
+ if : contains(github.ref, 'tags/v')
71
+ runs-on : ubuntu-latest
72
+ needs : build
73
+
74
+ steps :
75
+ - name : Create Release
76
+ id : create_release
77
+
78
+ env :
79
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
80
+ with :
81
+ tag_name : ${{ github.ref }}
82
+ release_name : Release ${{ github.ref }}
83
+ draft : false
84
+ prerelease : false
85
+
86
+ - name : Store Release url
87
+ run : |
88
+ echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
89
+
90
+ - uses : actions/upload-artifact@v1
91
+ with :
92
+ path : ./upload_url
93
+ name : upload_url
94
+
95
+ publish :
96
+ if : contains(github.ref, 'tags/v')
97
+
98
+ name : ${{ matrix.config.name }}
99
+ runs-on : ${{ matrix.config.os }}
100
+ strategy :
101
+ matrix :
102
+ config :
103
+ # - {
104
+ # name: "Windows Latest x64",
105
+ # artifact: "Windows-x64.zip",
106
+ # os: windows-latest
107
+ # }
108
+ - {
109
+ name : " Linux Latest x64" ,
110
+ artifact : " Linux-x64.zip" ,
111
+ os : ubuntu-latest
112
+ }
113
+ # - {
114
+ # name: "macOS Latest x64",
115
+ # artifact: "macOS-x64.zip",
116
+ # os: macos-latest
117
+ # }
118
+ needs : release
119
+
120
+ steps :
121
+ - name : Download artifact
122
+ uses : actions/download-artifact@v1
123
+ with :
124
+ name : ${{ env.PLUGIN_NAME }}-${{ env.QT_CREATOR_VERSION }}-${{ matrix.config.artifact }}
125
+ path : ./
126
+
127
+ - name : Download URL
128
+ uses : actions/download-artifact@v1
129
+ with :
130
+ name : upload_url
131
+ path : ./
132
+ - id : set_upload_url
133
+ run : |
134
+ upload_url=`cat ./upload_url`
135
+ echo ::set-output name=upload_url::$upload_url
136
+
137
+ - name : Upload to Release
138
+ id : upload_to_release
139
+
140
+ env :
141
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
142
+ with :
143
+ upload_url : ${{ steps.set_upload_url.outputs.upload_url }}
144
+ asset_path : ./qtusb-${{ matrix.config.artifact }}
145
+ asset_name : qtusb}-${{ matrix.config.artifact }}
146
+ asset_content_type : application/zip
0 commit comments