Skip to content

Commit 8c41a26

Browse files
authored
Merge pull request #237 from golobor/master
update the "publish" github action
2 parents c7c02e6 + d5d8948 commit 8c41a26

File tree

1 file changed

+58
-21
lines changed

1 file changed

+58
-21
lines changed
Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,68 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
# # This workflow will upload a Python Package using Twine when a release is created
2+
# # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

4-
name: Upload Python Package
4+
# name: Upload Python Package
5+
6+
# on:
7+
# release:
8+
# types: [created]
9+
10+
# jobs:
11+
# deploy:
12+
13+
# runs-on: ubuntu-latest
14+
15+
# steps:
16+
# - uses: actions/checkout@v2
17+
# - name: Set up Python
18+
# uses: actions/setup-python@v2
19+
# with:
20+
# python-version: '3.10'
21+
# - name: Install dependencies
22+
# run: |
23+
# python -m pip install --upgrade pip
24+
# pip install setuptools wheel twine cython pysam numpy
25+
# - name: Build and publish
26+
# env:
27+
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
# run: |
30+
# python setup.py sdist
31+
# twine upload dist/*
32+
33+
34+
name: Publish Python Package to PyPI
535

636
on:
737
release:
8-
types: [created]
38+
types: [published]
39+
workflow_dispatch:
940

1041
jobs:
11-
deploy:
42+
Publish:
43+
# prevents this action from running on forks
44+
if: github.repository == 'open2c/pairtools'
1245

1346
runs-on: ubuntu-latest
47+
permissions:
48+
id-token: write
1449

1550
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: '3.10'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine cython pysam numpy
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist
31-
twine upload dist/*
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Python
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: "3.x"
58+
59+
- name: Install dependencies
60+
run: |
61+
python -m pip install --upgrade pip
62+
pip install build
63+
64+
- name: Build
65+
run: python -m build
66+
67+
- name: Publish distribution 📦 to PyPI
68+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)