Skip to content

Commit

Permalink
feat: semantic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigimatsu committed Jan 17, 2022
1 parent c2cfb34 commit d1748be
Show file tree
Hide file tree
Showing 10 changed files with 486 additions and 85 deletions.
84 changes: 36 additions & 48 deletions .github/workflows/builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,81 +5,69 @@ on:
- main
paths-ignore:
- '.github/workflows/docs.yaml'
- '.github/workflows/tests.yaml'
- ".github/workflows/publish.yaml"
- '*.md'
pull_request:
branches:
- main

jobs:
bionic:
cmake:
# Bionic default: gcc 7, python 3.6
name: Bionic
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Build
run: |
mkdir -p build
cd build
cmake .. -DBUILD_PYTHON=ON
make
focal:
# Focal default: gcc 9, python 3.8
name: Focal
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

- name: Build
run: |
mkdir -p build
cd build
cmake .. -DBUILD_PYTHON=ON
make
macos:
# Catalina default: clang 12, python 3.9
name: macOS
runs-on: macos-latest
name: CMake ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-20.04
- macos-latest

steps:
- uses: actions/checkout@v2

- name: Build
env:
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
run: |
mkdir -p build
cd build
cmake .. -DBUILD_PYTHON=ON
cmake .. -DBUILD_PYTHON=ON -DPYBIND11_PYTHON_VERSION=3
make
ubuntu_pip:
name: Ubuntu pip
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
pip:
name: Pip ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest

- name: Install
run: |
pip install . -vvv
ubuntu_pip_dev:
name: Ubuntu pip dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install
env:
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
run: |
pip install -e . -vvv
pip3 install . -vvv
pip_dev:
name: Pip dev ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest

macos_pip:
name: macOS pip
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Install
env:
CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
run: |
pip3 install . -vvv
pip3 install --no-use-pep517 -e . -vvv
20 changes: 6 additions & 14 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
- main
paths-ignore:
- '.github/workflows/builds.yaml'
- '.github/workflows/tests.yaml'
- ".github/workflows/releases.yaml"
- ".github/workflows/publish.yaml"
- '*.md'
pull_request:
branches:
Expand All @@ -18,27 +19,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install dependencies
- name: Install pip dependencies
run: |
sudo apt install doxygen
pip install pipenv
pipenv install --dev
- name: Configure
- name: Build
run: |
mkdir -p build
cmake -B build -DBUILD_PYTHON=ON -DBUILD_DOCS=ON
- name: Generate cpp_redis Docs
run: |
cd external/cpp_redis/cpp_redis.git
git submodule update --init .
sed -i.old -E "s/^GENERATE_TAGFILE( +)=$/GENERATE_TAGFILE\1= cpp_redis.tag/" .doxygen
doxygen .doxygen
- name: Build
# ctrlutils neeeds to be in the virtual environment.
run: pipenv run pip install -e .
# spatialdyn needs to be in the virtual environment.
pipenv run pip install --no-use-pep517 -e .
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish
on: workflow_dispatch
# release:
# types:
# - published
# - edited

jobs:
build_wheels:
name: Build wheels ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v2
with:
path: wheelhouse/*.whl

upload_pypi:
name: Upload to PyPi
needs:
- build_wheels
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- name: Publish to PyPi
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release
on:
workflow_run:
workflows:
- Builds
types:
- completed

jobs:
release:
name: Release
runs-on: ubuntu-latest
concurrency: release
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.11)

# Define project
project(ctrl_utils
VERSION 1.4.0
VERSION 1.3.0
DESCRIPTION "Utility library for robot control"
LANGUAGES CXX
)
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ verify_ssl = true
sphinx = "*"
sphinxcontrib-doxylink = "*"
sphinx-autodoc-typehints = "*"
sphinx-bootstrap-theme = "*"
sphinx_bootstrap_theme = "*"

[packages]

Expand Down
Loading

0 comments on commit d1748be

Please sign in to comment.