yapb-noob-edition/.github/workflows/build.yml
2021-09-14 15:30:33 +03:00

133 lines
2.9 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:
- name: linux-x86
bin: yapb.so
opts: CXX=gcc-11 CXX_LD=gold meson setup build
- name: windows-x86
bin: yapb.dll
opts: meson setup build --cross-file=x86-windows
- name: macos-x86
bin: yapb.dylib
opts: meson setup build --cross-file=x86-darwin
name: ${{ matrix.name }}
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 }}
linux-aarch64:
name: linux-aarch64
runs-on: self-hosted
continue-on-error: true
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Configure Build
run: |
CXX=clang-12 CXX_LD=lld-12 meson setup build
- name: Compile Source
run: |
meson compile -v -C build
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: yapb.aarch64.so
path: build/yapb.so
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 }}