Skip to content

Commit

Permalink
.github/workflows: split build and deploy jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
yonidavidson committed May 11, 2023
1 parent 4b30fc0 commit 0fc1336
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
44 changes: 33 additions & 11 deletions .github/workflows/cd-pypi.yaml
Expand Up @@ -6,11 +6,8 @@ on:
branches:
- master
jobs:
deploy:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -25,11 +22,36 @@ jobs:
run: pipenv sync --dev
- name: Build package
run: pipenv run python -m build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Cache artifacts
uses: actions/upload-artifact@v3
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')
name: dist
path: dist/
deploy-test:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
deploy-prod:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -16,7 +16,7 @@
version="0.0.1",
description="A visualization tool.",
long_description=README,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
classifiers=[
# See https://pypi.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
Expand All @@ -32,17 +32,16 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"License :: OSI Approved :: Apache License",
"License :: OSI Approved :: Apache Software License",
],
keywords="django erd visualization",
author="Yoni Davidson",
author_email="y@ariga.io",
url="https://github.com/ariga/djangoviz",
license="MIT",
license="Apache License 2.0",
packages=find_packages(exclude=["tests*"]),
platforms=["any"],
zip_safe=True,
Expand Down

0 comments on commit 0fc1336

Please sign in to comment.