Skip to content

chore(ci): github build tag release workflow #2

chore(ci): github build tag release workflow

chore(ci): github build tag release workflow #2

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
branches:
- main
- master
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ubuntu-20.04

Check failure on line 22 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 22, Col: 13): Unexpected value 'ubuntu-20.04' .github/workflows/ci.yml (Line: 23, Col: 26): Unexpected value '703c36e7b7711ef441932025eebaabf4b7d5e548'
metamod-version: 703c36e7b7711ef441932025eebaabf4b7d5e548
python-version: '3.11'
include:
- os: ubuntu-20.04
target-archs: x86,x86_64
sdk: sdk2013
sdk-version: '4c27c1305c5e042ae1f62f6dc6ba7e96fd06e05d'
compiler_cc: gcc
compiler_cxx: g++
steps:
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -yq --no-install-recommends g++-multilib ${{ matrix.compiler_cc }}
- name: Select compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout
uses: actions/checkout@v4
with:
path: extension
- name: Checkout Metamod
uses: actions/checkout@v4
with:
repository: alliedmodders/metamod-source
ref: ${{ matrix.metamod-version }}
path: metamod-source
submodules: recursive
- name: Checkout hl2sdks
uses: actions/checkout@v4
with:
repository: alliedmodders/hl2sdk
ref: ${{ matrix.sdk-version }}
path: hl2sdk-${{ matrix.sdk }}
submodules: recursive
- name: Install AMBuild
run: |
python -m pip install wheel
python -m pip install git+https://github.com/alliedmodders/ambuild
- name: Build
working-directory: extension
shell: bash
env:
BREAKPAD_SYMBOL_SERVER: ${{ secrets.BREAKPAD_SYMBOL_SERVER }}
run: |
ls -all ../
mkdir build && cd build
python ../configure.py --enable-optimize --symbol-files --targets=${{ matrix.target-archs }} --sdks=${{ matrix.sdks }}
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}
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: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
ls -Rall
if [ -d "./Linux/" ]; then
cd ./Linux/
tar -czf ../${{ github.event.repository.name }}-${version}-linux.tar.gz -T <(\ls -1)
cd -
fi
if [ -d "./macOS/" ]; then
cd ./macOS/
tar -czf ../${{ github.event.repository.name }}-${version}-mac.tar.gz -T <(\ls -1)
cd -
fi
if [ -d "./Windows/" ]; then
cd ./Windows/
tar -czf ../${{ github.event.repository.name }}-${version}-windows.tar.gz -T <(\ls -1)
cd -
fi
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz'
tag: ${{ github.ref }}
file_glob: true