Skip to content

Commit 6144960

Browse files
authored
Merge pull request #1 from standard-crypto/gh-actions-publish
Create python-publish.yml
2 parents e8cbbf6 + b786317 commit 6144960

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow will upload a Python Package to PyPI when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
release-build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.9"
28+
29+
- name: Install pipenv and dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install pipenv
33+
pipenv install --dev
34+
35+
- name: Build release distributions
36+
run: |
37+
pipenv run build
38+
39+
- name: Upload distributions
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: walrus-dist
43+
path: dist/
44+
45+
pypi-publish:
46+
runs-on: ubuntu-latest
47+
needs:
48+
- release-build
49+
permissions:
50+
id-token: write
51+
52+
environment:
53+
name: pypi
54+
url: https://pypi.org/project/walrus-python/${{ github.event.release.tag_name }}
55+
56+
steps:
57+
- name: Retrieve release distributions
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: walrus-dist
61+
path: dist/
62+
63+
- name: Publish release distributions to PyPI
64+
uses: pypa/gh-action-pypi-publish@release/v1
65+
with:
66+
packages-dir: dist/

0 commit comments

Comments
 (0)