Build miasst #190
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: mingw-w64 | |
run: | | |
sudo apt install mingw-w64 -y | |
- 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: | | |
clang -target ${{ matrix.arch.clangtarget }}-w64-mingw32 -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 }} | |