Skip to content

Commit 0db56ad

Browse files
authored
Release workflows: always check that the built dist is valid. (#10408)
* Add typing_extensions to dependencies. * Add test PyPi action * Add to HOW_TO_RELEASE * Revert "Add typing_extensions to dependencies." This reverts commit e42965a. * edit workflow * more complex release * lint
1 parent 52677e1 commit 0db56ad

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/pypi-release.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ on:
66
push:
77
tags:
88
- "v*"
9+
pull_request:
10+
types: [opened, reopened, synchronize, labeled]
11+
workflow_dispatch:
912

1013
jobs:
1114
build-artifacts:
1215
runs-on: ubuntu-latest
13-
if: github.repository == 'pydata/xarray'
16+
if: ${{ github.repository == 'pydata/xarray' && (
17+
(contains(github.event.pull_request.labels.*.name, 'Release') && github.event_name == 'pull_request') ||
18+
github.event_name == 'release' ||
19+
github.event_name == 'workflow_dispatch' ||
20+
startsWith(github.ref, 'refs/tags/v')
21+
) }}
1422
steps:
1523
- uses: actions/checkout@v4
1624
with:
@@ -64,7 +72,6 @@ jobs:
6472
ls -ltrh dist
6573
6674
- name: Verify the built dist/wheel is valid
67-
if: github.event_name == 'push'
6875
run: |
6976
python -m pip install --upgrade pip
7077
python -m pip install dist/xarray*.whl

HOW_TO_RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ upstream https://github.com/pydata/xarray (push)
4848
release.
4949
5. Open a PR with the release summary and whatsnew changes; in particular the
5050
release headline should get feedback from the team on what's important to include.
51+
Apply the `Release` label to the PR to trigger a test build action.
52+
5153
6. After merging, again ensure your main branch is synced to upstream:
5254
```sh
5355
git pull upstream main

0 commit comments

Comments
 (0)