Build miasst #222
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 Mi-Assistant | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build MSYS2 Docker Image | |
run: | | |
echo 'FROM mcr.microsoft.com/windows/servercore:ltsc2022' > Dockerfile | |
echo 'SHELL ["powershell", "-Command"]' >> Dockerfile | |
echo 'RUN Invoke-WebRequest -Uri "https://github.com/msys2/msys2-installer/releases/latest/download/msys2-x86_64-latest.exe" -OutFile "msys2.exe";' >> Dockerfile | |
echo 'Start-Process -Wait -FilePath "msys2.exe" -ArgumentList ''/S'';' >> Dockerfile | |
echo 'Remove-Item -Force msys2.exe' >> Dockerfile | |
echo 'ENV PATH="C:\\msys64\\usr\\bin;C:\\msys64\\mingw64\\bin;C:\\msys64\\mingw32\\bin;${PATH}"' >> Dockerfile | |
echo 'WORKDIR /workspace' >> Dockerfile | |
docker build -t my-msys2-image . | |
- name: Build Project with MSYS2 | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace my-msys2-image /bin/bash -c " | |
pacman -Syu --noconfirm && \ | |
pacman -S --needed --noconfirm mingw-w64-x86_64-libusb mingw-w64-x86_64-curl && \ | |
gcc -o main.exe main.c libs/*.c -L/mingw64/lib -Ilibs -I/mingw64/include -lusb-1.0 -lcurl | |
" |