Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
offici5l authored Nov 2, 2024
1 parent 9980f11 commit e0281f0
Showing 1 changed file with 7 additions and 34 deletions.
41 changes: 7 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,20 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up MSYS2 for 32-bit
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
msystem: MINGW64
update: true
install: mingw-w64-i686-toolchain
install: mingw-w64-x86_64-toolchain

- name: Install p7zip
- name: Install dependencies (libusb and curl)
run: |
pacman -Syu --noconfirm
pacman -S --needed --noconfirm p7zip
shell: msys2 {0}

- name: Install libusb 1.0.27
run: |
wget -q https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z -O libusb.7z
7z x libusb.7z -o./libusb
mkdir -p /mingw32/include/libusb-1.0
cp -r libusb/include/* /mingw32/include/libusb-1.0/
cp -r libusb/MinGW32/dll/* /mingw32/lib/
shell: msys2 {0}

- name: Install curl
run: |
pacman -Syu --noconfirm
pacman -S --needed --noconfirm mingw-w64-i686-curl
shell: msys2 {0}

- name: Compile aes.c and md5.c
run: |
gcc -c libs/aes.c -o libs/aes.o
gcc -c libs/md5.c -o libs/md5.o
pacman -S --needed --noconfirm mingw-w64-x86_64-libusb mingw-w64-x86_64-curl
shell: msys2 {0}

- name: Compile main.c with aes.o and md5.o
run: |
gcc main.c libs/aes.o libs/md5.o -o test.exe -L/mingw32/lib -Ilibs -I/mingw32/include -lusb-1.0 -lcurl
shell: msys2 {0}

- name: Upload Release Assets
run: |
gh release upload ${{ env.VERSION }} ./test.exe --clobber
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
gcc -o main.exe main.c libs/*.c -L/mingw64/lib -Ilibs -I/mingw64/include -lusb-1.0 -lcurl
shell: msys2 {0}

0 comments on commit e0281f0

Please sign in to comment.