Build #4
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, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup msys2 | |
if: runner.os == 'Windows' | |
uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
zip | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-ninja | |
mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-curl-winssl | |
- name: Setup toolchain | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt update | |
sudo apt install -y libpcsclite-dev libcurl4-openssl-dev gcc make cmake | |
- name: Build for windows | |
if: runner.os == 'Windows' | |
run: | | |
mkdir build && cd build && cmake -DLINUX_MINGW32=ON .. && ninja | |
zip -r -j lpac-windows-x86_64.zip output/* | |
shell: msys2 {0} | |
- name: Build for Linux | |
if: runner.os == 'Linux' | |
run: | | |
mkdir build && cd build && cmake -D CMAKE_EXE_LINKER_FLAGS="-static" .. && make -j$(nproc) | |
chmod +x output/lpac | |
tar -czvf lpac-linux-x86_64.tar.gz -C output . | |
shell: bash | |
- 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: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
files: | | |
build/lpac-windows-x86_64.zip | |
build/lpac-linux-x86_64.tar.gz | |
build/lpac-macos-universal.zip |