Skip to content

Commit

Permalink
ci: add dependent publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kentbull committed Feb 28, 2024
1 parent f5c980b commit 5b3ca76
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build and Test
name: Build Package

env:
GIT_SSH_KEY: ${{ secrets.GIT_SSH_KEY }}
Expand Down Expand Up @@ -59,4 +59,10 @@ jobs:
run: pipenv run python -m pytest

- name: Build
run: pipenv run python -m build
run: pipenv run python -m build

- name: Archive package artifacts
uses: actions/upload-artifact@v3
with:
name: python-package
path: dist/*
36 changes: 36 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Publish Package

env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/

on:
workflow_run:
workflows: ["Build Package"]
branches: ["main"]
types:
- completed

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Download pacakge artifacts
uses: actions/download-artifact@v3
with:
name: python-package

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install twine
run: |
python -m pip install --upgrade pip
python -m pip install twine
- name: Publish
run: pipenv run twine upload dist/*

0 comments on commit 5b3ca76

Please sign in to comment.