Skip to content

Commit 9f107b0

Browse files
Merge pull request #29 from ACCESS-NRI/add-pypi-dist
Add PyPI job to CD.yml
2 parents 24c590e + 9bb42d9 commit 9f107b0

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/CD.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,34 @@ on:
66
- '*'
77

88
jobs:
9+
pypi:
10+
name: build and deploy to PyPI
11+
if: github.repository == 'ACCESS-NRI/yamanifest' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
12+
runs-on: "ubuntu-latest"
13+
permissions:
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout source
18+
uses: actions/[email protected]
19+
20+
- name: Set up Python 3.11
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.11
24+
25+
- name: Install build dependencies
26+
run: python -m pip install build twine
27+
28+
- name: Build distributions
29+
shell: bash -l {0}
30+
run: |
31+
git clean -xdf
32+
pyproject-build
33+
34+
- name: Publish package to PyPI
35+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
36+
937

1038
conda:
1139
name: Build with conda and upload
@@ -49,4 +77,4 @@ jobs:
4977
python-version: ${{ vars.PY_VERSION }}
5078
user: accessnri
5179
label: main
52-
token: ${{ secrets.ANACONDA_TOKEN }}
80+
token: ${{ secrets.ANACONDA_TOKEN }}

0 commit comments

Comments
 (0)