Skip to content

Bumped to 0.1.0

Bumped to 0.1.0 #53

Workflow file for this run

name: Build
on:
workflow_dispatch:
push:
tags:
- '*'
env:
COLCON_DEFAULTS_FILE: src/navground/colcon/defaults.yaml
jobs:
build_cpp:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-latest
- windows-latest
- macos-latest
name: Build C++ 📦
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
path: src/navground
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: install colcon
run: pip install colcon-common-extensions
- name: load deps
uses: actions/cache/restore@v4
id: cache
with:
path: install
key: ${{ matrix.os }}-${{ hashFiles('src/navground/installation/deps.repos', 'src/navground/installation/ament.repos') }}
- uses: ilammy/msvc-dev-cmd@v1
- name: download deps
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install vcstool
vcs import --shallow --input src/navground/installation/deps.repos
vcs import --shallow --input src/navground/installation/ament.repos
- name: build deps (win)
if: ${{runner.os == 'Windows' && steps.cache.outputs.cache-hit != 'true' }}
run: |
set COLCON_DEFAULTS_FILE=src\navground\colcon\defaults.yaml
colcon build --event-handlers desktop_notification- --metas src\navground\colcon\navground.meta --packages-up-to argparse Eigen3 YAML_CPP GEOS HighFive HDF5 pybind11 ament_cmake ament_package ament_index_cpp
- name: build deps (unix)
if: ${{runner.os != 'Windows' && steps.cache.outputs.cache-hit != 'true' }}
run: colcon build --metas src/navground/colcon/navground.meta --packages-up-to argparse Eigen3 YAML_CPP GEOS HighFive HDF5 pybind11 ament_cmake ament_package ament_index_cpp
- name: save deps
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: install
key: ${{ matrix.os }}-${{ hashFiles('src/navground/installation/deps.repos', 'src/navground/installation/ament.repos') }}
- name: build navground (unix)
if: runner.os != 'Windows'
run: |
source install/setup.bash
colcon build --metas src/navground/colcon/navground.meta --packages-select navground_core navground_sim # navground_examples
- name: build navground (win)
if: runner.os == 'Windows'
run: |
install\setup.ps1
set COLCON_DEFAULTS_FILE=src\navground\colcon\defaults.yaml
colcon build --event-handlers desktop_notification- --metas src\navground\colcon\navground.meta --packages-select navground_core navground_sim # navground_examples
- name: archive install
uses: actions/upload-artifact@v4
with:
name: install-${{ matrix.os }}
path: install
if-no-files-found: error
build_py:
needs: build_cpp
name: Build Python 📦
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
path: src/navground
fetch-depth: 0
- name: download install
uses: actions/download-artifact@v4
with:
name: install-${{ matrix.os }}
path: install
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: install build deps
run: pip install colcon-common-extensions wheel setuptools build setuptools_git_versioning libclang repairwheel
- name: install pybind11_mkdoc
run: |
git clone --depth=1 https://github.com/jeguzzi/pybind11_mkdoc.git --branch rst src/pybind11_mkdoc
cd src/pybind11_mkdoc
pip install .
cd -
- uses: ilammy/msvc-dev-cmd@v1
- name: build navground (unix)
if: runner.os != 'Windows'
run: |
source install/setup.bash
colcon build --metas src/navground/colcon/navground.meta --packages-select navground_core_py navground_sim_py # navground_examples_py
- name: build navground (win)
if: runner.os == 'Windows'
run: |
install\setup.ps1
set COLCON_DEFAULTS_FILE=src\navground\colcon\defaults.yaml
colcon build --event-handlers console_direct+ --event-handlers desktop_notification- --metas src\navground\colcon\navground.meta --packages-select navground_core_py navground_sim_py # navground_examples_py
- name: archive logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: log-${{ matrix.os }}-py${{matrix.python-version}}
path: log
if-no-files-found: error
- name: archive install
uses: actions/upload-artifact@v4
with:
name: install-${{ matrix.os }}-py${{matrix.python-version}}
path: install
if-no-files-found: error
- name: build wheel (win)
if: runner.os == 'Windows'
run: |
install\setup.ps1
cd src\navground\navground_py
python setup.py bdist_wheel
$fileNames = Get-ChildItem -Path dist -Recurse -Include *.whl
repairwheel -o ..\..\..\dist $fileNames[0]
- name: build wheel (unix)
if: runner.os != 'Windows'
run: |
source install/setup.bash
cd src/navground/navground_py
python setup.py bdist_wheel
repairwheel -o ../../../dist dist/*.whl
- name: archive wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.os }}-py${{matrix.python-version}}
path: dist/*
if-no-files-found: error
publish-to-testpypi:
needs: build_py
name: Publish wheels to TestPyPI
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/navground
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- run: |
echo "Ignore generic linux wheels:" $(find dist -type f | grep linux_x86_64)
rm -f dist/*linux_x86_64*
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
publish-to-pypi:
needs: build_py
name: Publish wheels to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/navground # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- run: |
echo "Ignore generic linux wheels:" $(find dist -type f | grep linux_x86_64)
rm -f dist/*linux_x86_64*
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'