-
Notifications
You must be signed in to change notification settings - Fork 466
100 lines (93 loc) · 2.85 KB
/
mingw.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
name: MinGW
on:
push:
paths-ignore:
- '.gitignore'
- '.gitattributes'
- '**.cmd'
- '**.md'
- 'AUTHORS'
- 'NEWS'
- 'ChangeLog'
pull_request:
paths-ignore:
- '.gitignore'
- '.gitattributes'
- '**.cmd'
- '**.md'
- 'AUTHORS'
- 'NEWS'
- 'ChangeLog'
env:
WDK_URL: https://go.microsoft.com/fwlink/p/?LinkID=253170
LIBUSB0_URL: https://github.com/mcuee/libusb-win32/releases/download/release_1.4.0.0/libusb-win32-bin-1.4.0.0.zip
LIBUSBK_URL: https://github.com/mcuee/libusbk/releases/download/V3.1.0.0/libusbK-3.1.0.0-bin.7z
BUILD_OPTIONS: '--enable-toggable-debug --enable-examples-build --disable-debug --disable-shared'
DRIVERS_PATHS: '--with-wdkdir="wdk/Windows Kits/8.0" --with-wdfver=1011 --with-libusb0="libusb0" --with-libusbk="libusbk/bin"'
jobs:
MinGW-Build:
runs-on: windows-latest
strategy:
matrix:
include:
- { sys: mingw64, env: x86_64 }
- { sys: mingw32, env: i686 }
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MinGW
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
mingw-w64-${{ matrix.env }}-toolchain
base-devel
autotools
git
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Download support files
shell: cmd
run: |
curl -L ${{ env.WDK_URL }} -o wdk-redist.msi
curl -L ${{ env.LIBUSB0_URL }} -o libusb0-redist.zip
curl -L ${{ env.LIBUSBK_URL }} -o libusbk-redist.7z
msiexec /a wdk-redist.msi /qn TARGETDIR=%CD%\wdk
7z x libusb0-redist.zip
7z x libusbk-redist.7z
del *.zip
del *.7z
move libusb-win32* libusb0
move libusbK* libusbk
- name: Build
run: |
./bootstrap.sh
[ "${{ matrix.env }}" == "x86_64" ] && EXTRA_OPTION=--disable-32bit
./configure --build=${{ matrix.env }}-w64-mingw32 --host=${{ matrix.env }}-w64-mingw32 ${{ env.BUILD_OPTIONS }} $EXTRA_OPTION ${{ env.DRIVERS_PATHS }}
make
mkdir -p artifacts/${{ matrix.env }}
mv examples/*.exe artifacts/${{ matrix.env }}
- name: Display SHA-256
if: ${{ github.event_name == 'push' }}
run: sha256sum artifacts/${{ matrix.env }}/*.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'push' }}
with:
name: ${{ matrix.sys }}
path: ./artifacts/*/*.exe
Merge-Artifacts:
runs-on: windows-latest
needs: MinGW-Build
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
if: ${{ github.event_name == 'push' }}
with:
name: MinGW
delete-merged: true