Skip to content

Commit 884f383

Browse files
committed
update 2.8 branch workflows
1 parent 1938fe3 commit 884f383

2 files changed

Lines changed: 167 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Publish
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
build:
6+
name: Build distribution
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v5
11+
with:
12+
persist-credentials: false
13+
- name: Set up Python
14+
uses: actions/setup-python@v6
15+
with:
16+
python-version: "3.x"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: python3 -m build
25+
- name: Store the distribution packages
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: python-package-distributions
29+
path: dist/
30+
31+
publish-to-pypi:
32+
name: Publish Python distribution to PyPI
33+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/dnspython_test
41+
42+
permissions:
43+
id-token: write
44+
45+
steps:
46+
- name: Download all the dists
47+
uses: actions/download-artifact@v5
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
- name: Publish distribution to TestPyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
with:
54+
verbose: true
55+
56+
# build-test:
57+
# name: Build distribution
58+
# runs-on: ubuntu-latest
59+
60+
# steps:
61+
# - uses: actions/checkout@v5
62+
# with:
63+
# persist-credentials: false
64+
# - name: Set up Python
65+
# uses: actions/setup-python@v6
66+
# with:
67+
# python-version: "3.x"
68+
# - name: Update project
69+
# run: python3 ./util/make-test-project
70+
# - name: Install pypa/build
71+
# run: >-
72+
# python3 -m
73+
# pip install
74+
# build
75+
# --user
76+
# - name: Build a binary wheel and a source tarball
77+
# run: python3 -m build
78+
# - name: Store the distribution packages
79+
# uses: actions/upload-artifact@v4
80+
# with:
81+
# name: python-test-package-distributions
82+
# path: dist/
83+
84+
# publish-to-testpypi:
85+
# name: Publish Python distribution to TestPyPI
86+
# needs:
87+
# - build-test
88+
# runs-on: ubuntu-latest
89+
90+
# environment:
91+
# name: testpypi
92+
# url: https://test.pypi.org/p/dnspython_test
93+
94+
# permissions:
95+
# id-token: write
96+
97+
# steps:
98+
# - name: Download all the dists
99+
# uses: actions/download-artifact@v5
100+
# with:
101+
# name: python-test-package-distributions
102+
# path: dist/
103+
# - name: Publish distribution to TestPyPI
104+
# uses: pypa/gh-action-pypi-publish@release/v1
105+
# with:
106+
# repository-url: https://test.pypi.org/legacy/
107+
# verbose: true
108+
# attestations: false

.github/workflows/test-publish.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Test Publish
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
build-test:
6+
name: Build distribution
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v5
11+
with:
12+
persist-credentials: false
13+
- name: Set up Python
14+
uses: actions/setup-python@v6
15+
with:
16+
python-version: "3.x"
17+
- name: Update project
18+
run: python3 ./util/make-test-project
19+
- name: Install pypa/build
20+
run: >-
21+
python3 -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: python3 -m build
27+
- name: Store the distribution packages
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: python-test-package-distributions
31+
path: dist/
32+
33+
publish-to-testpypi:
34+
name: Publish Python distribution to TestPyPI
35+
if: startsWith(github.ref, 'refs/tags/') # only publish on tag pushes
36+
needs:
37+
- build-test
38+
runs-on: ubuntu-latest
39+
40+
environment:
41+
name: testpypi
42+
url: https://test.pypi.org/p/dnspython_test
43+
44+
permissions:
45+
id-token: write
46+
47+
steps:
48+
- name: Download all the dists
49+
uses: actions/download-artifact@v5
50+
with:
51+
name: python-test-package-distributions
52+
path: dist/
53+
- name: Publish distribution to TestPyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
repository-url: https://test.pypi.org/legacy/
57+
verbose: true
58+
attestations: false
59+

0 commit comments

Comments
 (0)