zdray/.github/workflows/continuous_integration.yml

99 lines
2.3 KiB
YAML
Raw Permalink Normal View History

name: Continuous Integration
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Linux Clang",
os: ubuntu-20.04,
extra_options: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
}
- {
name: "Linux GCC",
os: ubuntu-20.04
}
- {
name: "macOS",
os: macos-12
}
- {
name: "Windows",
os: windows-2022
}
steps:
- uses: actions/checkout@v3
- name: Configure
shell: bash
run: |
cmake -B build ${{ matrix.config.extra_options }} .
- name: Build
shell: bash
run: |
export MAKEFLAGS=--keep-going
cmake --build build --config Release --parallel 3
2024-02-19 13:39:03 +00:00
- name: Create Package
if: runner.os == 'Windows' # Remove to make packages of all targets
shell: bash
run: |
cd build
mkdir package
if [[ "${{ runner.os }}" == 'Windows' ]]; then
2024-02-19 13:43:05 +00:00
cp Release/zdray.exe package
2024-02-19 13:39:03 +00:00
elif [[ "${{ runner.os }}" == 'macOS' ]]; then
cp zdray package
elif [[ "${{ runner.os }}" == 'Linux' ]]; then
cp zdray package
fi
- name: Upload Package
if: runner.os == 'Windows' # Remove to store packages of all targets
uses: actions/upload-artifact@v4
with:
path: build/package
name: ${{ matrix.config.name }}
- name: List Build Directory
if: always()
shell: bash
run: |
git status
ls -lR build
2024-02-19 13:39:03 +00:00
deploy:
name: Update Latest successful build
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Windows
path: build/zdray-prerelease
- name: Zip artifacts
shell: bash
run: |
cd build
zip -r zdray-prerelease.zip zdray-prerelease
- name: Update nightly release
uses: pyTooling/Actions/releaser@r0
with:
tag: nightly
rm: true
token: ${{ secrets.GITHUB_TOKEN }}
files: build/zdray-prerelease.zip