File tree Expand file tree Collapse file tree 4 files changed +58
-37
lines changed
Expand file tree Collapse file tree 4 files changed +58
-37
lines changed Original file line number Diff line number Diff line change 3333 - uses : actions/upload-artifact@v3
3434 with :
3535 name : ${{ inputs.artifact-name }}
36- path : dist
36+ path : " dist/ "
Original file line number Diff line number Diff line change 2626 - name : Fetch built emsarray package
2727 uses : actions/download-artifact@v3
2828 with :
29- name : ${{ inputs.python -artifact-name }}
29+ name : ${{ inputs.package -artifact-name }}
3030 path : " dist/"
3131
3232 - name : Cache conda packages
Original file line number Diff line number Diff line change @@ -113,38 +113,3 @@ jobs:
113113 with :
114114 name : Docs
115115 path : docs/_build/dirhtml
116-
117- publish :
118- runs-on : ubuntu-latest
119- timeout-minutes : 5
120- needs : ['build', 'test', 'lint', 'docs']
121- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
122-
123- steps :
124- - name : Fetch Python package
125- uses : actions/download-artifact@v3
126- with :
127- name : ${{ needs.build.outputs.artifact-name }}
128- path : " dist"
129-
130- - name : " Check tag matches version"
131- shell : bash -l {0}
132- run : |
133- VERSION="$( echo "${{ github.ref }}" | sed 's!refs/tags/v!!' )"
134- echo "Looking for packages with version $VERSION"
135- ls -l dist/*
136- packages=(
137- "dist/emsarray-$VERSION.tar.gz"
138- "dist/emsarray-$VERSION-*.whl"
139- )
140- for package in "${packages[@]}" ; do
141- if ! test -e $package ; then
142- echo "Could not find $package"
143- exit 1
144- fi
145- done
146-
147- - name : " Publish Python package"
148- uses : pypa/gh-action-pypi-publish@release/v1
149- with :
150- password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Publish a new version to PyPI
2+ on :
3+ push :
4+ tags :
5+ - " v[0-9]+.*"
6+
7+ workflow_dispatch :
8+
9+ env :
10+ python-version : " 3.11"
11+
12+ jobs :
13+ build :
14+ runs-on : ubuntu-latest
15+ outputs :
16+ artifact-name : ${{ steps.build.outputs.artifact-name }}
17+ steps :
18+ - uses : actions/checkout@v3
19+ - uses : ./.github/actions/build-python-package
20+ id : build
21+ with :
22+ python-version : ${{ env.python-version }}
23+
24+ publish :
25+ runs-on : ubuntu-latest
26+ timeout-minutes : 5
27+ needs : ['build']
28+
29+ steps :
30+ - name : Fetch Python package
31+ uses : actions/download-artifact@v3
32+ with :
33+ name : ${{ needs.build.outputs.artifact-name }}
34+ path : " dist"
35+
36+ - name : " Check tag matches version"
37+ shell : bash -l {0}
38+ run : |
39+ VERSION="$( echo "${{ github.ref }}" | sed 's!refs/tags/v!!' )"
40+ echo "Looking for packages with version $VERSION"
41+ ls -l dist/*
42+ packages=(
43+ "dist/emsarray-$VERSION.tar.gz"
44+ "dist/emsarray-$VERSION-*.whl"
45+ )
46+ for package in "${packages[@]}" ; do
47+ if ! test -e $package ; then
48+ echo "Could not find $package"
49+ exit 1
50+ fi
51+ done
52+
53+ - name : " Publish Python package"
54+ uses : pypa/gh-action-pypi-publish@release/v1
55+ with :
56+ password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments