Merge branch 'main' of github.com:estkme/lpac into main #26
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libpcsclite-dev libcurl4-openssl-dev gcc make cmake gcc-mingw-w64 g++-mingw-w64 unzip ninja-build | |
sudo snap install zig --classic --beta | |
- name: Build for Linux(X86_64) | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
mkdir build && cd build && cmake .. -GNinja && ninja | |
chmod +x output/lpac | |
zip -r -j lpac-linux-x86_64.zip output/* | |
- name: Build for Debian | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
mkdir build-deb && cd build-deb && cmake .. -GNinja -DCPACK_GENERATOR=DEB && ninja package | |
- name: Build for Windows(X86_64 MinGW) | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
mkdir build-mingw && cd build-mingw && cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64.cmake .. && ninja | |
wget --no-verbose https://curl.se/windows/dl-8.6.0_1/curl-8.6.0_1-win64-mingw.zip -O curl.zip && unzip curl.zip && mv curl-8.6.0_1-win64-mingw/bin/libcurl-x64.dll output/libcurl.dll | |
zip -r -j lpac-windows-x86_64-mingw.zip output/* | |
- name: Build for WoA(GNU Toolchain) | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
mkdir woa-gnu-cross-toolchain && cd woa-gnu-cross-toolchain | |
wget --no-verbose https://github.com/Windows-on-ARM-Experiments/mingw-woarm64-build/releases/download/2024-02-08/aarch64-w64-mingw32-msvcrt-toolchain.tar.gz && tar xf aarch64-w64-mingw32-msvcrt-toolchain.tar.gz | |
cd ../ && mkdir build-woa-mingw && cd build-woa-mingw && cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64-woa.cmake -DTOOLCHAIN_BIN_PATH=$GITHUB_WORKSPACE/woa-gnu-cross-toolchain/bin && ninja | |
wget https://curl.se/windows/dl-8.6.0_1/curl-8.6.0_1-win64a-mingw.zip -O curl.zip && unzip curl.zip && mv curl-8.6.0_1-win64a-mingw/bin/libcurl-arm64.dll output/libcurl.dll | |
zip -r -j lpac-windows-arm64-mingw.zip output/* | |
- name: Build for WoA(zig) | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
mkdir build-woa-zig && cd build-woa-zig && cmake .. -GNinja -DCMAKE_TOOLCHAIN_FILE=./cmake/aarch64-windows-zig.cmake && ninja | |
wget --no-verbose https://curl.se/windows/dl-8.6.0_1/curl-8.6.0_1-win64a-mingw.zip -O curl.zip && unzip curl.zip && mv curl-8.6.0_1-win64a-mingw/bin/libcurl-arm64.dll output/libcurl.dll | |
zip -r -j lpac-windows-arm64-zig.zip output/* | |
- name: Build for macOS | |
if: runner.os == 'macOS' | |
run: | | |
mkdir build && cd build && cmake .. && make -j$(sysctl -n hw.ncpu) | |
chmod +x output/lpac | |
zip -r -j lpac-macos-universal.zip output/* | |
shell: bash | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-${{ matrix.os }} | |
path: | | |
build-mingw/lpac-windows-x86_64-mingw.zip | |
build-woa-mingw/lpac-windows-arm64-mingw.zip | |
build-woa-zig/lpac-windows-arm64-zig.zip | |
build-deb/lpac-*.deb | |
build/lpac-linux-x86_64.zip | |
build/lpac-macos-universal.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
build-mingw/lpac-windows-x86_64-mingw.zip | |
build-woa-mingw/lpac-windows-arm64-mingw.zip | |
build-woa-zig/lpac-windows-arm64-zig.zip | |
build-deb/lpac-*.deb | |
build/lpac-linux-x86_64.zip | |
build/lpac-macos-universal.zip |