release #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python: ['3.9', '3.10', '3.11'] | |
steps: | |
- uses: compas-dev/compas-actions.build@v3 | |
with: | |
python: ${{ matrix.python }} | |
invoke_lint: true | |
invoke_test: false | |
- name: Run unit tests | |
run: | | |
pytest tests/unit | |
integration_tests: | |
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')" | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Set up docker container | |
run: | | |
docker run -d --name nanomq -p 1883:1883 -p 8083:8083 -p 8883:8883 emqx/nanomq:latest | |
docker ps -a | |
- uses: compas-dev/compas-actions.build@v3 | |
with: | |
python: '3.11' | |
invoke_lint: false | |
invoke_test: false | |
- name: Run integration tests | |
run: | | |
pytest tests/integration | |
- name: Tear down docker container | |
run: | | |
docker rm -f nanomq | |
Publish: | |
needs: build | |
runs-on: windows-latest | |
steps: | |
# The steps should rely on compas-actions.publish | |
# but this bug is blocking it: https://github.com/compas-dev/compas-actions.publish/issues/1 | |
# so atm, it's a copy of the steps | |
# - uses: compas-dev/compas-actions.publish@v2 | |
# with: | |
# pypi_token: ${{ secrets.PYPI }} | |
# github_token: ${{ secrets.TOKEN }} | |
# build_ghpython_components: true | |
# gh_source: src/compas_eve/ghpython/components | |
# gh_target: src/compas_eve/ghpython/components/ghuser | |
# release_name_prefix: COMPAS EVE v | |
- uses: actions/checkout@v3 | |
- name: Get Version From Tag | |
id: tag_name | |
run: | | |
echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ steps.tag_name.outputs.current_version }} | |
path: ./CHANGELOG.md | |
- name: Assemble Release Name | |
id: assemble_release_name | |
shell: bash | |
run: | | |
release_name="COMPAS EVE v${{ steps.tag_name.outputs.current_version }}" | |
echo Using release name: $release_name | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
token: ${{ secrets.TOKEN }} | |
name: ${{ steps.assemble_release_name.outputs.release_name }} | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install CPython dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel | |
python -m pip install --no-cache-dir -r requirements-dev.txt | |
- uses: NuGet/[email protected] | |
- name: Install dependencies | |
run: | | |
choco install ironpython --version=2.7.8.1 | |
- uses: compas-dev/compas-actions.ghpython_components@v4 | |
with: | |
source: src/compas_eve/ghpython/components | |
target: src/compas_eve/ghpython/components/ghuser | |
prefix: "" | |
- shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
python setup.py clean --all sdist bdist_wheel | |
twine check dist/* | |
twine upload dist/* --skip-existing | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI }} |