Skip to content

backport: nodes flooder (analyzer) from cs-ebot #320

backport: nodes flooder (analyzer) from cs-ebot

backport: nodes flooder (analyzer) from cs-ebot #320

Workflow file for this run

name: build
on:
push:
branches: [master]
paths-ignore:
- '**.md'
pull_request:
types: [opened, reopened, synchronize]
release:
types: [published]
jobs:
bot-build:
runs-on: ubuntu-latest
container:
image: j4sdk/x86-buildtools:lunar
options: --hostname github-actions
strategy:
matrix:
arch: ['linux-x86', 'linux-x86-gcc', 'linux-aarch64', 'darwin-x86', 'windows-x86', 'windows-x86-gcc']
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Configure meson
shell: bash
run: |
if [[ ${{matrix.arch}} == linux-x86 ]]; then
CXX=clang CXX_LD=lld meson setup ${{matrix.arch}}
elif [[ ${{matrix.arch}} == linux-x86-gcc ]]; then
CXX=gcc CXX_LD=gold meson setup ${{matrix.arch}}
else
meson setup ${{matrix.arch}}/ --cross-file ${{matrix.arch}}
fi
- name: Build sources
shell: bash
run: |
meson compile -C ${{matrix.arch}}
echo "artifcat=${{matrix.arch}}/`ls ${{matrix.arch}}/ | egrep '^yapb.(so|dylib|dll)$' | head -1`" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{matrix.arch}}
path: ${{env.artifcat}}
bot-msvc:
env:
name: windows-x86-msvc
name: bot-build (windows-x86-msvc)
runs-on: windows-latest
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: Install meson
run: |
python -m pip install --upgrade meson ninja
- name: Configure meson
run: |
meson setup ${{env.name}}
- name: Build sources
run: |
meson compile -C ${{env.name}}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.name}}
path: ${{env.name}}/yapb.dll
bot-release:
if: |
github.event_name == 'release' &&
github.event.action == 'published'
name: bot-release
runs-on: ubuntu-latest
needs: [bot-build, bot-msvc]
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 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: Configure meson
run: |
python -m pip install --upgrade meson ninja requests
- 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}}