Skip to content

Build and Release

Build and Release #15

name: Build and Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
triplet: x64-windows
build-script: .\vcpkg\bootstrap-vcpkg.bat
cmake-command: |
cmake -B ./build
cmake --build ./build --config Release
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
${{ matrix.build-script }}
- name: Install dependencies
run: |
./vcpkg/vcpkg install crow civetweb zlib --triplet=${{ matrix.triplet }}
- name: Configure and build
run: |
${{ matrix.cmake-command }}
- name: Package executable for Windows
if: matrix.os == 'windows-latest'
run: |
mkdir -p release
cp ./*.exe release/ || echo "No executables found"
cp ./*.dll release/ || echo "No DLLs found"
cp -r libs/ release/ || echo "No libs directory found"
# Use PowerShell's Compress-Archive for zipping files on Windows
powershell Compress-Archive -Path release/* -DestinationPath windows-latest_release.zip
- name: Package executable for Linux
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p release
cp ./* release/ || echo "No executables found"
cp ./build/output/*.so release/ || echo "No shared libraries found"
cp -r libs/ release/ || echo "No libs directory found"
# Use zip for Linux
zip -r ubuntu-latest_release.zip release/
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-build
path: ${{ matrix.os }}_release.zip
release:
runs-on: ubuntu-latest

Check failure on line 68 in .github/workflows/build-and-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-and-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 68
needs: build
steps:
- name: Download Windows build artifact
uses: actions/download-artifact@v3
with:
name: windows-latest-build
path: windows-latest_release.zip
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: windows-latest_release.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}