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: ghcr.io/yapb/builder:latest options: --hostname github-actions strategy: matrix: arch: ['linux-x86', 'linux-amd64', 'linux-x86-gcc', 'linux-aarch64', 'darwin-x86', 'windows-x86-clang', 'windows-amd64', '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}} elif [[ ${{matrix.arch}} == linux-amd64 ]]; then CXX=clang CXX_LD=lld meson setup ${{matrix.arch}} -D64bit=true elif [[ ${{matrix.arch}} == windows-amd64 ]]; then meson setup ${{matrix.arch}} --cross-file ${{matrix.arch}} -D64bit=true 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 strategy: matrix: arch: ['windows-x86', 'windows-x86-msvc-xp'] fail-fast: false 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 shell: pwsh run: | if ('${{matrix.arch}}' -eq 'windows-x86-msvc-xp') { meson setup ${{matrix.arch}} -Dwinxp=true } else { meson setup ${{matrix.arch}} } - name: Build sources run: | meson compile -C ${{matrix.arch}} - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: ${{matrix.arch}} path: | ${{matrix.arch}}/yapb.dll ${{matrix.arch}}/yapb.pdb 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}}