Skip to content

Commit

Permalink
fix(ci): push to testpypi on push(main), push to pypi on tag (#7)
Browse files Browse the repository at this point in the history
* fix(ci): force testpypi publish to only run on push to main
  • Loading branch information
cboin1996 authored Apr 16, 2024
1 parent cad0bed commit 37b486a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

# only run this workflow if tests has completed successfully on the main branch
on:
workflow_run:
workflows: ["tests"]
types: ["completed"]
push:
tags:
- "*"
on: push

jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Build distribution 📦
runs-on: ubuntu-latest

Expand Down Expand Up @@ -105,7 +97,8 @@ jobs:
needs:
- build
runs-on: ubuntu-latest

# run if push to main
if: github.ref == 'refs/heads/main'
environment:
name: testpypi
url: https://test.pypi.org/p/requests-htmlc
Expand Down

0 comments on commit 37b486a

Please sign in to comment.