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