Skip to content

Commit 69bbd91

Browse files
committed
ci: merge publish and binary building together
1 parent b243df1 commit 69bbd91

File tree

2 files changed

+50
-59
lines changed

2 files changed

+50
-59
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Binaries
1+
name: Release
22

33
on:
44
push:
@@ -7,11 +7,55 @@ on:
77
workflow_dispatch:
88
inputs:
99
tag:
10-
description: "Release tag to append binaries to (e.g., v2.0.0)"
10+
description: "Release tag to build binaries for (e.g., v2.0.0)"
1111
required: true
1212
type: string
1313

1414
jobs:
15+
publish-pypi:
16+
name: Publish to PyPI
17+
runs-on: ubuntu-latest
18+
if: github.event_name == 'push'
19+
environment: pypi
20+
permissions:
21+
id-token: write
22+
contents: write
23+
steps:
24+
- uses: actions/checkout@v5
25+
26+
- name: Install uv and setup the python version
27+
uses: astral-sh/setup-uv@v7
28+
29+
- name: Install the project
30+
run: uv sync --all-groups
31+
32+
- name: Run tests
33+
run: uv run pytest
34+
35+
- name: Build wheel
36+
run: uv build
37+
38+
- name: Publish package
39+
env:
40+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
41+
run: uv publish
42+
43+
- name: Create GitHub Release
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
generate_release_notes: true
47+
body: |
48+
## Installation
49+
50+
```bash
51+
pipx install kseal==${{ github.ref_name }}
52+
```
53+
54+
## PyPI Package
55+
https://pypi.org/project/kseal/${{ github.ref_name }}/
56+
57+
---
58+
1559
build:
1660
name: Build (${{ matrix.os }}-${{ matrix.arch }})
1761
runs-on: ${{ matrix.runner }}
@@ -63,9 +107,10 @@ jobs:
63107
name: kseal-${{ matrix.os }}-${{ matrix.arch }}
64108
path: dist/kseal-${{ matrix.os }}-${{ matrix.arch }}
65109

66-
release:
67-
name: Append to Release
68-
needs: build
110+
upload-binaries:
111+
name: Upload Binaries to Release
112+
needs: [build, publish-pypi]
113+
if: always() && needs.build.result == 'success' && (needs.publish-pypi.result == 'success' || needs.publish-pypi.result == 'skipped')
69114
runs-on: ubuntu-latest
70115
permissions:
71116
contents: write
@@ -78,9 +123,6 @@ jobs:
78123
path: binaries
79124
merge-multiple: true
80125

81-
- name: List binaries
82-
run: ls -la binaries/
83-
84126
- name: Upload binaries to release
85127
env:
86128
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)