linux actions #29
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 and Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
include: | ||
# Windows Configuration | ||
- os: windows-latest | ||
triplet: x64-windows | ||
build-script: .\vcpkg\bootstrap-vcpkg.bat | ||
cmake-generator: "Visual Studio 16 2019" | ||
cmake-arch: x64 | ||
cmake-command: | | ||
Check failure on line 22 in .github/workflows/build-and-release.yml GitHub Actions / Build and ReleaseInvalid workflow file
Check failure on line 22 in .github/workflows/build-and-release.yml GitHub Actions / Build and ReleaseInvalid workflow file
|
||
cmake -G "${{ matrix.cmake-generator }}" -A ${{ matrix.cmake-arch }} -B ./build -DCMAKE_BUILD_TYPE=Release | ||
cmake --build ./build --config Release | ||
package-command: | | ||
mkdir release | ||
copy .\build\Release\*.exe release\ || echo "No executables found" | ||
copy .\build\Release\*.dll release\ || echo "No DLLs found" | ||
copy .\libs\* release\ || echo "No libs directory found" | ||
powershell Compress-Archive -Path release\* -DestinationPath windows_release.zip | ||
artifact-name: windows-build | ||
artifact-path: windows_release.zip | ||
# Linux Configuration | ||
- os: ubuntu-latest | ||
triplet: x64-linux | ||
build-script: ./vcpkg/bootstrap-vcpkg.sh | ||
cmake-command: | | ||
cmake -B ./build -DCMAKE_BUILD_TYPE=Release | ||
cmake --build ./build --config Release | ||
package-command: | | ||
mkdir release | ||
cp ./build/* release/ || echo "No executables found" | ||
cp ./build/*.so release/ || echo "No shared libraries found" | ||
cp -r libs/ release/ || echo "No libs directory found" | ||
tar -czvf linux_release.tar.gz -C release . | ||
artifact-name: linux-build | ||
artifact-path: linux_release.tar.gz | ||
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: List build directory (Debugging) | ||
run: | | ||
dir build | ||
dir build\Release | ||
- name: Package executable | ||
run: | | ||
${{ matrix.package-command }} | ||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.artifact-name }} | ||
path: ${{ matrix.artifact-path }} | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: '**-build' | ||
path: . | ||
- name: List downloaded files (Debugging step) | ||
run: ls -al | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
windows_release.zip | ||
linux_release.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} |