167 lines
3.7 KiB
YAML
167 lines
3.7 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths-ignore:
|
|
- '**.md'
|
|
|
|
pull_request:
|
|
types: [opened, reopened, synchronize]
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
unix:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: linux-x86
|
|
bin: yapb.so
|
|
opts: CXX=gcc-11 CXX_LD=gold meson setup build
|
|
|
|
- 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@v3
|
|
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@v3
|
|
with:
|
|
name: ${{ matrix.bin }}
|
|
path: build/${{ matrix.bin }}
|
|
|
|
windows:
|
|
name: windows-x86
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: true
|
|
|
|
- name: Setup MSBuild
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: amd64_x86
|
|
|
|
- name: Setup Meson
|
|
run: |
|
|
python -m pip install --upgrade meson ninja
|
|
|
|
- name: Configure Build
|
|
run: |
|
|
meson setup build
|
|
|
|
- name: Compile Source
|
|
run: |
|
|
meson compile -v -C build
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: yapb.dll
|
|
path: build/yapb.dll
|
|
|
|
linux-arm64:
|
|
name: linux-arm64
|
|
|
|
runs-on: self-hosted
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
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: Rename Binary
|
|
run: |
|
|
mv build/yapb.so build/yapb.arm64.so
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: yapb.arm64.so
|
|
path: build/yapb.arm64.so
|
|
|
|
publish:
|
|
if: |
|
|
github.event_name == 'release' &&
|
|
github.event.action == 'published'
|
|
|
|
name: publish
|
|
runs-on: ubuntu-latest
|
|
needs: [unix, windows, linux-arm64]
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v3
|
|
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@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
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 }}
|