Skip to content

Commit

Permalink
Merge pull request #12 from dynatrace-extensions/PublishAction
Browse files Browse the repository at this point in the history
Added publish action, direct link to documentation in README
  • Loading branch information
dlopes7 authored Dec 8, 2023
2 parents fbd3c14 + 0306009 commit b1ba2d8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish to PyPI
on: push

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install hatch and build
run: >-
python3 -m
pip install
hatch
--user
- name: Build a binary wheel and a source tarball
run: python3 -m hatch build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dt-extensions-sdk
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download dist from build
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ hatch run docs:build

## License

`dt-extensions-sdk` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
`dt-extensions-sdk` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## Documentation

[Documentation](https://dynatrace-extensions.github.io/dt-extensions-python-sdk/)

## Publishing to PyPI

It's automatically published to PyPi on each pushed tag, and uses [gh-action-pypi-publish](https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/)
Version will be determined using __about__.py

0 comments on commit b1ba2d8

Please sign in to comment.