Skip to content

Commit dd007a0

Browse files
committed
Release package - 01
1 parent ef0a396 commit dd007a0

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/release.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
10+
name: Upload Python Package
11+
12+
on:
13+
release:
14+
types: [published]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
release-build:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.11"
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
make requirements
34+
make requirements-build
35+
36+
- name: Build release distributions
37+
run: |
38+
make build-package
39+
40+
- name: Upload distributions
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: release-dists
44+
path: dist/
45+
46+
pypi-publish:
47+
runs-on: ubuntu-latest
48+
49+
needs:
50+
- release-build
51+
52+
permissions:
53+
# IMPORTANT: this permission is mandatory for trusted publishing
54+
id-token: write
55+
56+
# Dedicated environments with protections for publishing are strongly recommended.
57+
environment:
58+
name: release
59+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
60+
# url: https://pypi.org/p/YOURPROJECT
61+
62+
steps:
63+
- name: Retrieve release distributions
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: release-dists
67+
path: dist/
68+
69+
- name: Publish release distributions to PyPI
70+
uses: pypa/gh-action-pypi-publish@release/v1

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ release:
9595
git tag v$(VERSION) -m "$(MSG)"; \
9696
git push --tags origin master
9797

98+
99+
build-package:
100+
python setup.py sdist
101+
98102
# Catch-all target: route all unknown targets to Sphinx using the new
99103
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
100104
%: Makefile

0 commit comments

Comments
 (0)