Skip to content

Commit

Permalink
Configure GitHub to automate publishing DAG Factory in PyPI (#255)
Browse files Browse the repository at this point in the history
Automate the release process using GitHub actions so we can consistently
make release 0.20.0 and future releases.

As part of this change, I've already generated a PyPI upload token and
configured the environment variable `PYPI_TOKEN` as a GitHub secret.
  • Loading branch information
tatiana authored Oct 17, 2024
1 parent 01e0871 commit 540b33a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Publish-Package:
if: github.event_name == 'release'
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs:
- Static-Check
- Run-Unit-Tests
- Code-Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
- run: pip3 install hatch
- run: hatch build
- run: hatch publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,18 @@ Source = "https://github.com/astronomer/dag-factory"
[tool.hatch.version]
path = "dagfactory/__init__.py"

[tool.hatch.build]
sources = ["."]

[tool.hatch.build.targets.sdist]
include = ["dagfactory"]

[tool.hatch.build.targets.wheel]
packages = ["dagfactory"]

[tool.distutils.bdist_wheel]
universal = true

[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning"]
minversion = "6.0"
Expand Down

0 comments on commit 540b33a

Please sign in to comment.