Skip to content

fix(ci): update ci

fix(ci): update ci #25

Workflow file for this run

name: Build and release
on:
push:
branches:
- main
- master
tags:
- 'v*.*.*'
pull_request:
branches:
- main
- master
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2022, macos-12]
sourcemod-version: [1.11-dev]
include:
- os: ubuntu-20.04
target-archs: x86,x86_64
platform: linux
- os: windows-2022
target-archs: x86,x86_64
platform: windows
- os: macos-12
target-archs: x86_64
platform: macos
steps:
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -yq --no-install-recommends g++-multilib
- name: Set up Python
uses: actions/setup-python@v4
- name: Checkout
uses: actions/checkout@v4
with:
path: extension
- name: Checkout SourceMod
uses: actions/checkout@v4
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sourcemod-version }}
path: sourcemod
submodules: recursive
- name: Install AMBuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Build
working-directory: extension
shell: bash
env:
BREAKPAD_SYMBOL_SERVER: ${{ secrets.BREAKPAD_SYMBOL_SERVER }}
run: |
mkdir build && cd build
perl ../curl/lib/mk-ca-bundle.pl
python ../configure.py --enable-optimize --targets=${{ matrix.target-archs }}
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-${{ matrix.platform }}-${{ matrix.sourcemod-version }}
path: extension/build/package
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Package
run: |
for folder in ./*; do
if [ -d "$folder" ]; then
echo "Processing folder: $folder"
cd $folder
tar -czf ../$folder.tar.gz -T <(\ls -1)
cd ..
sha256sum $folder.tar.gz > $folder.tar.gz.sha256
fi
done
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz*'
tag: ${{ github.ref }}
file_glob: true