Skip to content

Commit 6c72be0

Browse files
achristie-ima.b.christie
andauthored
Switch to trusted publishing (#2)
* ci: Switch to trusted pubisher * ci: Update publish notes --------- Co-authored-by: a.b.christie <alan.christie@matildapeak.com>
1 parent e26badb commit 6c72be0

2 files changed

Lines changed: 26 additions & 23 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
11
---
2-
name: publish
3-
4-
# Actions for any tag.
52

6-
# -----------------
7-
# Control variables (GitHub Secrets)
8-
# -----------------
9-
#
10-
# At the GitHub 'organisation' or 'project' level you must have the following
11-
# GitHub 'Repository Secrets' defined (i.e. via 'Settings -> Secrets'): -
12-
#
13-
# PYPI_USERNAME
14-
# PYPI_TOKEN
15-
#
16-
# -----------
17-
# Environment (GitHub Environments)
18-
# -----------
19-
#
20-
# Environment (none)
3+
# Publish the application to PyPI
4+
name: publish
215

226
on:
237
push:
248
tags:
259
- '**'
2610

2711
jobs:
28-
build-and-publish:
12+
build:
2913
runs-on: ubuntu-latest
3014
steps:
3115
- name: Checkout
@@ -44,8 +28,27 @@ jobs:
4428
run: |
4529
echo $GITHUB_REF_SLUG > src/squeck/VERSION
4630
uv build
31+
- name: Store the distribution
32+
uses: actions/upload-artifact@v5
33+
with:
34+
name: python-package-distribution
35+
path: dist/
36+
37+
publish:
38+
name: Publish to PyPI
39+
needs:
40+
- build
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/xchem-hippo
45+
permissions:
46+
id-token: write
47+
steps:
48+
- name: Download distribution
49+
uses: actions/download-artifact@v6
50+
with:
51+
name: python-package-distribution
52+
path: dist/
4753
- name: Publish
4854
uses: pypa/gh-action-pypi-publish@release/v1
49-
with:
50-
user: ${{ secrets.PYPI_USERNAME }}
51-
password: ${{ secrets.PYPI_TOKEN }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Informatics Matters Ltd
3+
Copyright (c) 2026 Informatics Matters Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)