-
Notifications
You must be signed in to change notification settings - Fork 3
executable file
·42 lines (33 loc) · 1.59 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
name: Build for Windows
on:
workflow_dispatch:
env:
VERSION: 1.1
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- target: "32"
clangtarget: "i686"
- target: "64"
clangtarget: "x86_64"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install MinGW-w64
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-i686 gcc-mingw-w64-x86-64
- name: Download and extract libusb and curl
run: |
mkdir -p d && curl -L -o libusb.7z https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z && 7z x libusb.7z -od && rm libusb.7z && mkdir -p include && mkdir -p include/curl && mkdir -p include/libusb-1.0 && find d -type f -exec cp -n {} include/libusb-1.0 \; -delete && rm -r d && curl -L -o curl.zip https://curl.se/windows/dl-8.10.1_7/curl-8.10.1_7-win${{ matrix.arch.target }}-mingw.zip && unzip curl.zip && find curl-8.10.1_7-win${{ matrix.arch.target }}-mingw -type f -exec cp -n {} include/curl \; -delete && rm curl.zip && rm -r curl-8.10.1_7-win${{ matrix.arch.target }}-mingw
- name: Build Project
run: |
${{ matrix.arch.clangtarget }}-w64-mingw32-gcc -I./include -L./include/{curl,libusb-1.0} -o miasst_windows_${{ matrix.arch.target }}.exe main.c libs/*.c -lcurl -lusb-1.0
- name: Upload Release Assets
run: |
gh release upload ${{ env.VERSION }} ./miasst_windows_${{ matrix.arch.target }}.exe --clobber
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}