fixed python imports #6
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: CI | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
PYTHON_VERSION: 3.11 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel | |
- name: "Find version" | |
if: startsWith(github.ref, 'refs/tags/') | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: image | |
tags: type=semver,pattern={{version}} | |
- name: "Adjust version number in setup.cfg" | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
sed -i'' "s/0\\.0\\.0/${{ steps.meta.outputs.version }}/" setup.cfg | |
- name: Build Python package | |
run: python setup.py sdist bdist_wheel | |
- name: Upload package to artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: python-packages | |
path: | | |
dist/*.whl | |
dist/*.tar.gz | |
- uses: crazy-max/ghaction-github-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dist/*.whl | |
dist/*.tar.gz |