Skip to content

Commit

Permalink
Merge pull request #27 from hejung/more_packaging
Browse files Browse the repository at this point in the history
Improve publish to pypi-workflow
  • Loading branch information
hejung authored Jan 10, 2025
2 parents 314fb66 + d83ef54 commit 644ced2
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish asyncmd to PyPI and TestPyPI

on:
push:
branches: ["main"]
tags: ["v*"] # run only on version-tag pushes

jobs:
build:
Expand Down Expand Up @@ -35,9 +35,8 @@ jobs:
publish-to-pypi:
name: >-
Publish asyncmd to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
- test-testpypi-install
runs-on: ubuntu-latest
environment:
name: pypi
Expand Down Expand Up @@ -120,3 +119,21 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

test-testpypi-install:
name: Test TestPyPi Installation
needs:
- publish-to-testpypi
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install asyncmd from TestPyPi (no-deps)
run: >-
python3 -m
pip install
--index-url https://test.pypi.org/simple/
--no-deps

0 comments on commit 644ced2

Please sign in to comment.