Skip to content

Commit 9bd6f8d

Browse files
committed
ci: publish to pypi
1 parent 5429399 commit 9bd6f8d

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

.github/workflows/cd-publish.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: "CD: Build & Publish"
22

33
# TODO: Notify
4-
# TODO: Publish to PyPI
54

65
on:
76
pull_request:
@@ -157,3 +156,38 @@ jobs:
157156
files: dist/*
158157
env:
159158
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159+
160+
pypi-publish:
161+
name: Publish to PyPI
162+
runs-on: ubuntu-latest
163+
needs: [build]
164+
permissions:
165+
id-token: write
166+
steps:
167+
- name: "[INIT] Checkout"
168+
uses: actions/checkout@v5
169+
with:
170+
fetch-depth: 0
171+
172+
- name: "[DOWNLOAD] Artifacts"
173+
uses: actions/download-artifact@v4
174+
with:
175+
name: dist-artifacts
176+
path: dist/
177+
178+
- name: "[INIT] Install Nix"
179+
uses: cachix/install-nix-action@v31
180+
with:
181+
nix_path: nixpkgs=channel:nixos-unstable
182+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
183+
184+
- name: "[INIT] Setup Cachix"
185+
uses: cachix/cachix-action@v15
186+
with:
187+
name: amperser
188+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
189+
190+
- name: "[PUBLISH] PyPI via uv"
191+
if: ${{ github.event_name == 'workflow_dispatch' }}
192+
run: |
193+
nix develop --command uv publish

0 commit comments

Comments
 (0)