67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
actions: write
|
|
|
|
env:
|
|
CONAN_HOME: build/build_common/conan_cache
|
|
MODULUS_DIRECT: "1"
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install build dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
ca-certificates \
|
|
cmake \
|
|
g++-12 \
|
|
g++-aarch64-linux-gnu \
|
|
gcc-12 \
|
|
gcc-aarch64-linux-gnu \
|
|
git \
|
|
ninja-build \
|
|
pkg-config \
|
|
python3 \
|
|
python3-venv
|
|
python3 -m venv build/build_common/ci_python
|
|
build/build_common/ci_python/bin/python -m pip install --no-cache-dir conan==2.26.2
|
|
echo "$PWD/build/build_common/ci_python/bin" >> "$GITHUB_PATH"
|
|
- name: Restore Conan cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: build/build_common/conan_cache
|
|
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', 'modulus.json') }}
|
|
restore-keys: conan-${{ runner.os }}-
|
|
- name: Configure native release
|
|
run: python3 modulus.py configure --target x86_64_gcc12_release --update
|
|
- name: Check code style
|
|
run: |
|
|
python3 -m pip install --no-cache-dir -r build/build_tools/docker/format-requirements.txt
|
|
python3 modulus.py format --check
|
|
- name: Build native release
|
|
run: python3 modulus.py build --target x86_64_gcc12_release
|
|
- name: Test native release
|
|
run: python3 modulus.py test --target x86_64_gcc12_release
|
|
- name: Create and upload packages
|
|
if: ${{ gitea.event_name == 'workflow_dispatch' || (gitea.event_name == 'push' && gitea.ref == 'refs/heads/master') }}
|
|
env:
|
|
CONAN_USER: ${{ secrets.CONAN_USER }}
|
|
CONAN_TOKEN: ${{ secrets.CONAN_TOKEN }}
|
|
LIGO_CONAN_UPLOAD: "1"
|
|
MODULUS_ALLOW_PACKAGE_REPLACE: "1"
|
|
run: python3 modulus.py package --all --replace --update
|