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