Skip to content

Commit

Permalink
Update python-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dfjswanson authored Apr 24, 2024
1 parent b7e8323 commit e499bce
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,17 @@ jobs:
with:
name: python-package-distributions
path: dist/
- name: Set environment based on branch
id: identify
run: |
BRANCH=$(git log -1 --format='%D' ${{ github.ref }} | grep -Eo '[^\/]+$')
echo $BRANCH
echo "branch_name=${BRANCH}" >> $GITHUB_OUTPUT
outputs:
branch_name: ${{ steps.identify.outputs.branch_name }}


publish-to-pypi:
name: publish python distribution to PyPi based on environment
publish-to-testpypi:
name: publish python distribution to TestPyPi
needs:
- build
runs-on: ubuntu-latest

environment:
name: ${{ needs.build.outputs.branch_name }}
url: ${{ vars.PYPI_URL }}
name: testpypi
url: https://test.pypi.org/p/dataforge-core

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand All @@ -78,9 +69,9 @@ jobs:
with:
name: python-package-distributions
path: dist/
- name: publish dist to PyPi
- name: publish dist to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
#with:
# repository-url: https://test.pypi.org/legacy/
with:
repository-url: https://test.pypi.org/legacy/


0 comments on commit e499bce

Please sign in to comment.