Skip to content

Update README.md #317

Update README.md

Update README.md #317

Workflow file for this run

name: CI
on:
push:
branches:
- "master"
tags:
- "*"
pull_request:
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Add vcpkg to github env
run: echo "VCPKG_INSTALLATION_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Addd vcpkg to github env
run: echo "VCPKG_INSTALLATION_ROOT=$VCPKG_INSTALLATION_ROOT" >> "$GITHUB_ENV"
if: matrix.os != 'windows-latest'
- name: Cache vcpkg
id: vcpkg-cache
uses: actions/cache@v3
with:
path: |
${{ env.VCPKG_INSTALLATION_ROOT }}/installed
${{ env.VCPKG_INSTALLATION_ROOT }}/packages
key: ${{ hashFiles('**/vcpkg_*.txt') }}-${{ runner.os }}-vcpkg
- run: sudo apt-get update
if: matrix.os == 'ubuntu-latest'
- run: sudo apt-get install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev
if: matrix.os == 'ubuntu-latest'
- run: echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- run: echo "VCPKG_DEFAULT_TRIPLET=x64-linux" >> "$GITHUB_ENV"
if: matrix.os == 'ubuntu-latest'
- run: echo "VCPKG_DEFAULT_TRIPLET=x64-osx" >> "$GITHUB_ENV"
if: matrix.os == 'macos-latest'
- run: vcpkg install "@vcpkg_response_file.txt"
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
env:
VCPKG_DEFAULT_TRIPLET: ${{ env.VCPKG_DEFAULT_TRIPLET }}
- run: cmake -DCMAKE_BUILD_TYPE=Release -Bbuild
- run: cmake --build build --config Release
if: matrix.os == 'windows-latest'
- name: Package
if: startsWith(github.ref, 'refs/tags') && matrix.os == 'windows-latest'
run: cmake --build build --target package --config Release
- run: cmake --build build
if: matrix.os != 'windows-latest'
- name: Package
if: startsWith(github.ref, 'refs/tags') && matrix.os != 'windows-latest'
run: cmake --build build --target package
- run: mv build/voxelscape.zip build/voxelscape-${{ env.VCPKG_DEFAULT_TRIPLET }}.zip
if: startsWith(github.ref, 'refs/tags')
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/voxelscape-${{ env.VCPKG_DEFAULT_TRIPLET }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}