Skip to content

Commit 81f07b6

Browse files
ci: refine publishing WF (#202)
* ci: update CI workflow to use `buildwheel` action. Signed-off-by: Yurii Serhiichuk <[email protected]> * docs: Add pipeline change to the changelog Signed-off-by: Yurii Serhiichuk <[email protected]> * chore: temporary add ability to build on PRs. Signed-off-by: Yurii Serhiichuk <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ci: Do not try using cibuildwheels Signed-off-by: Yurii Serhiichuk <[email protected]> * docs: Update changelog Signed-off-by: Yurii Serhiichuk <[email protected]> * ci: don't build on PRs Signed-off-by: Yurii Serhiichuk <[email protected]> * ci: don't fetch repo history on publish Signed-off-by: Yurii Serhiichuk <[email protected]> Signed-off-by: Yurii Serhiichuk <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent cf5616b commit 81f07b6

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

.github/workflows/pypi-release.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,54 @@
11
name: PyPI-Release
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
78

89
jobs:
9-
build-and-publish:
10-
runs-on: ubuntu-latest
10+
build_dist:
11+
name: Build source distribution
12+
runs-on: ubuntu-22.04
1113
steps:
1214
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Build SDist and wheel
19+
run: pipx run build
20+
21+
- uses: actions/upload-artifact@v3
22+
with:
23+
path: dist/*
24+
25+
- name: Check metadata
26+
run: pipx run twine check dist/*
27+
publish:
28+
runs-on: ubuntu-22.04
29+
if: github.event_name == 'push'
30+
needs: [ build_dist ]
31+
steps:
32+
- uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
1335
- name: Set up Python
1436
uses: actions/setup-python@v4
1537
with:
1638
python-version: "3.10"
1739
cache: 'pip'
1840
- name: Install build dependencies
1941
run: pip install -U setuptools wheel build
20-
- name: Build
21-
run: python -m build .
42+
- uses: actions/download-artifact@v3
43+
with:
44+
# unpacks default artifact into dist/
45+
# if `name: artifact` is omitted, the action will create extra parent dir
46+
name: artifact
47+
path: dist
2248
- name: Publish
2349
uses: pypa/gh-action-pypi-publish@release/v1
2450
with:
51+
user: __token__
2552
password: ${{ secrets.pypi_password }}
2653
- name: Install GitPython and cloudevents for pypi_packaging
2754
run: pip install -U -r requirements/publish.txt

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Changed
9+
- Refined build and publishing process. Added SDist to the released package ([#202])
810

911
## [1.7.0] — 2022-11-17
1012
### Added
@@ -225,3 +227,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
225227
[#191]: https://github.com/cloudevents/sdk-python/pull/191
226228
[#195]: https://github.com/cloudevents/sdk-python/pull/195
227229
[#197]: https://github.com/cloudevents/sdk-python/pull/197
230+
[#202]: https://github.com/cloudevents/sdk-python/pull/202

0 commit comments

Comments
 (0)