diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 0000000..bfe532f --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,13 @@ +on: + push: + branches: + - master + tags: + - "^[0-9]+.[0-9]+.[0-9]+" + +jobs: + build_and_deploy: + uses: sensirion/.github/.github/workflows/driver.python.pypi_publish.yml@main + secrets: + PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000..4d5f98c --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,11 @@ +name: Publish Documentation +on: + push: + branches: + - master + tags: + - "^[0-9]+.[0-9]+.[0-9]+" + +jobs: + documentation: + uses: sensirion/.github/.github/workflows/driver.python.documentation.yml@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..615fdfb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,12 @@ +name: Validate and Test Python Package +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + test: + uses: sensirion/.github/.github/workflows/driver.python.test.yml@main diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 9e82c94..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,73 +0,0 @@ -include: https://gitlab/Sensirion/Python/ci-config-python/raw/master/gitlab-ci-template-v2.yml - -variables: - PYTEST_ADDOPTS: '-m "not needs_device"' - -check_rst_syntax: - extends: .check_rst_syntax_v2 - -check_editorconfig: - extends: .check_editorconfig_v2 - -py2p7_linux_build: - extends: .py2p7_linux_build_v2 - -py3p6_linux_build: - extends: .py3p6_linux_build_v2 - -py3p8_linux_build: - extends: .py3p8_linux_build_v2 - -py2p7_32bit_win_build: - extends: .py2p7_32bit_win_docker_build_v2 - -py3p5_64bit_win_build: - extends: .py3p5_64bit_win_docker_build_v2 - -py3p8_64bit_win_build: - extends: .py3p8_64bit_win_docker_build_v2 - - -build_docs: - extends: .build_docs_v2 - script: - - python setup.py install - - pip install -r docs/requirements.txt - - ./ci/set_git_config.sh - - sphinx-versioning build -r "$CI_COMMIT_REF_NAME" -w "$CI_COMMIT_REF_NAME" docs docs/_build/html - after_script: - # overwrite after_script from template - artifacts: - paths: [docs/_build] - expire_in: 1 week - when: always - - -deploy_staging: - extends: .deploy_staging_v2 - -deploy_stable: - extends: .deploy_stable_v2 - environment: - name: pypi.org - url: https://pypi.org/project/sensirion-i2c-svm41/ - before_script: - - pip install twine~=1.12.1 - script: - - PKG_VERSION=$(python setup.py --version --quiet | tail -n1) - - TAG_VERSION=$(git describe --tags) - - if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then echo "Tag Version ($TAG_VERSION) != Package Version ($PKG_VERSION)" && exit 1; fi - - twine upload dist/* - - -deploy_docs: - stage: deploy - tags: [linux, docker] - image: registry.gitlab.sensirion.lokal/sensirion/docker/docker-python:3.6-18.04-2.7.0 - dependencies: [] - only: [master, tags] - script: - - python setup.py install - - pip install -r docs/requirements.txt - - ./ci/set_git_config.sh - - sphinx-versioning push docs gh-pages .