-
Notifications
You must be signed in to change notification settings - Fork 326
74 lines (63 loc) · 2.23 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This will run every time a release is created and published.
# It calls our tests workflow via a `workflow_call`, and if tests pass
# then it triggers our upload to PyPI for a new release.
name: Publish to PyPI
on:
release:
types:
- published
schedule:
- cron: "0 2 * * *" # at 2AM UTC
workflow_dispatch:
env:
FORCE_COLOR: "1" # Make tools pretty.
permissions:
contents: read
jobs:
# calls our general CI workflow (tests, build docs, etc.)
tests:
uses: ./.github/workflows/CI.yml
# needed for the coverage action
permissions:
contents: write
pull-requests: write
build-package:
name: "Build & verify PST package"
needs: [tests] # require tests to pass before deploy runs
runs-on: ubuntu-latest
steps:
- name: "Checkout repository 🛎"
uses: actions/checkout@v4
- name: "Setup CI environment 🛠"
uses: ./.github/actions/set-dev-env
with:
python-version: "3.9"
pandoc: "False"
- name: "Build and inspect package 📦"
uses: hynek/build-and-inspect-python-package@v2
id: baipp
- run: echo Packages can be found at ${{ steps.baipp.outputs.dist }}
release-pypi:
runs-on: ubuntu-latest
needs: [build-package]
permissions:
id-token: write # needed for PyPI upload
steps:
- name: "Download PST built package 📦"
uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: "Unzip artifact"
run: |
tar xvf dist/*.tar.gz --strip-components=1
- name: "Publish PST package to PyPI 🚀"
uses: pypa/gh-action-pypi-publish@release/v1
# only publish if this is a published release by pydata
if: github.repository_owner == 'pydata' && github.event_name == 'release' && github.event.action == 'published'
- name: "Publish PST package to scientific-python-nightly-wheels 🚀"
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
if: github.repository_owner == 'pydata' && github.event_name == 'schedule'