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

Skip to content

Commit 9bd76d6

Browse files
committed
publishing workflow
1 parent b34cf14 commit 9bd76d6

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: "Publish"
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: "${{ github.workflow }}-${{ github.ref }}"
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build_package:
17+
name: "Build"
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: "Check out the repo"
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
with:
24+
persist-credentials: false
25+
26+
- name: "Set up Python"
27+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
28+
with:
29+
python-version: "3.12"
30+
31+
- name: "Install dependencies"
32+
run: |
33+
python -m pip install .[dev]
34+
35+
- name: "Build dists"
36+
run: |
37+
python -m build --sdist --wheel
38+
39+
- name: "Upload dists"
40+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
41+
with:
42+
name: dists
43+
path: dist/*
44+
retention-days: 7
45+
46+
publish_package:
47+
name: "Publish"
48+
needs: build_package
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: pypi
52+
#url: <URL TO YOUR PROJECT HERE>
53+
permissions:
54+
id-token: write # needed for publishing to PyPI
55+
56+
steps:
57+
- name: "Download artifacts"
58+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
59+
with:
60+
name: dists
61+
path: dist/
62+
63+
- name: "Publish to PyPI"
64+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

0 commit comments

Comments
 (0)