yapb-noob-edition/.github/workflows/build.yml
dmitry 28e9f44dee
build: simplify workflow
linux; switch to gcc to support older hlds builds as well
win32: switch to clang as default compiler
2021-09-12 13:04:05 +03:00

106 lines
2.4 KiB
YAML

name: build
on:
push:
branches: [master]
paths-ignore:
- '**.md'
pull_request:
types: [opened, reopened, synchronize]
release:
types: [published]
jobs:
builds:
strategy:
matrix:
include:
- type: windows
bin: yapb.dll
opts: meson setup build --cross-file=x86-windows
- type: linux
bin: yapb.so
opts: CXX=gcc-11 CXX_LD=gold meson setup build
- type: macos
bin: yapb.dylib
opts: meson setup build --cross-file=x86-darwin
name: ${{ matrix.type }}
runs-on: ubuntu-latest
container: j4sdk/x86-buildtools:latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Configure Build
run: |
${{ matrix.opts }}
- name: Compile Source
run: |
meson compile -v -C build
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.bin }}
path: build/${{ matrix.bin }}
publish:
if: |
github.event_name == 'release' &&
github.event.action == 'published'
name: publish
runs-on: ubuntu-latest
needs: [builds]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Install Signing Tools
run: |
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y --no-install-recommends osslsigncode
- name: Get Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup Meson
run: |
python -m pip install --upgrade meson ninja urllib3
- name: Create Packages
run: |
meson setup dist
ninja -C dist package
env:
CS_CERTIFICATE: ${{ secrets.CS_CERTIFICATE }}
CS_CERTIFICATE_PASSWORD: ${{ secrets.CS_CERTIFICATE_PASSWORD }}
- name: Publish Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: pkg/*
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}