Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0ffb07c

Browse files
authored
Merge pull request #49 from phobson/clean-up-publisher-GHAs
separate testpypi & pypi publishing
2 parents f420c0d + c95ea5d commit 0ffb07c

File tree

3 files changed

+61
-26
lines changed

3 files changed

+61
-26
lines changed

.github/workflows/python-publish.yml renamed to .github/workflows/python-publish-pypi.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
22

3-
on: push
3+
on:
4+
release:
5+
types: [published]
46

57
jobs:
68
build:
@@ -91,27 +93,3 @@ jobs:
9193
gh release upload
9294
'${{ github.ref_name }}' dist/**
9395
--repo '${{ github.repository }}'
94-
95-
publish-to-testpypi:
96-
name: Publish Python 🐍 distribution 📦 to TestPyPI
97-
needs:
98-
- build
99-
runs-on: ubuntu-latest
100-
101-
environment:
102-
name: test
103-
url: https://test.pypi.org/p/<package-name>
104-
105-
permissions:
106-
id-token: write # IMPORTANT: mandatory for trusted publishing
107-
108-
steps:
109-
- name: Download all the dists
110-
uses: actions/download-artifact@v3
111-
with:
112-
name: python-package-distributions
113-
path: dist/
114-
- name: Publish distribution 📦 to TestPyPI
115-
uses: pypa/gh-action-pypi-publish@release/v1
116-
with:
117-
repository-url: https://test.pypi.org/legacy/
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish Python 🐍 distribution 📦 to TestPyPI
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '*' # Push events to every tag not containing /
8+
9+
jobs:
10+
build:
11+
name: Build distribution 📦
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.x"
20+
- name: Install pypa/build
21+
run: >-
22+
python3 -m
23+
pip install
24+
build
25+
--user
26+
- name: Build a binary wheel and a source tarball
27+
run: python3 -m build
28+
- name: Store the distribution packages
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
35+
publish-to-testpypi:
36+
name: Publish Python 🐍 distribution 📦 to TestPyPI
37+
needs:
38+
- build
39+
runs-on: ubuntu-latest
40+
41+
environment:
42+
name: test
43+
url: https://test.pypi.org/p/paramnormal
44+
45+
permissions:
46+
id-token: write # IMPORTANT: mandatory for trusted publishing
47+
48+
steps:
49+
- name: Download all the dists
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
- name: Publish distribution 📦 to TestPyPI
55+
uses: pypa/gh-action-pypi-publish@release/v1
56+
with:
57+
repository-url: https://test.pypi.org/legacy/

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
DESCRIPTION = "paramnormal: Conventionally parameterized probability distributions"
88
LONG_DESCRIPTION = DESCRIPTION
99
NAME = "paramnormal"
10-
VERSION = "v0.4.1"
10+
VERSION = "v0.4.2"
1111
AUTHOR = "Paul Hobson"
1212
AUTHOR_EMAIL = "[email protected]"
1313
URL = "http://phobson.github.io/paramnormal/"

0 commit comments

Comments
 (0)