File tree Expand file tree Collapse file tree 2 files changed +41
-43
lines changed
Expand file tree Collapse file tree 2 files changed +41
-43
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11name : Deploy packages to PyPI and Anaconda
22on :
3- release :
4- types : [released]
3+ push :
4+ tags :
5+ - ' v*.*.*'
6+ - ' v*.*'
57jobs :
8+
9+ # Check that the tag matches the lastest version in the code
10+ check-version :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Check version
15+ run : |
16+ # Get the latest version from the code
17+ latest_version=$(sed -r 's/__version__ = "(.*)"/\1/' ravenpackapi/version.py)
18+ # Get the tag from the git tag
19+ tag=$(echo $GITHUB_REF | sed -r 's/refs\/tags\/v(.*)/\1/')
20+ # Check that the tag matches the latest version
21+ if [ "$latest_version" != "$tag" ]; then
22+ echo "The tag $tag does not match the latest version $latest_version"
23+ exit 1
24+ fi
25+
626 # Build packages
727 build :
28+ needs : check-version
829 uses : ./.github/workflows/build.yml
930
1031 # Anaconda
6081 path : dist/
6182 - name : Publish package distributions to PyPI
6283 uses : pypa/gh-action-pypi-publish@release/v1
84+
85+ # Create a release
86+ github-release :
87+ needs :
88+ - deploy-pypi
89+ name : >-
90+ Create a GitHub Release
91+ runs-on : ubuntu-latest
92+ steps :
93+ - uses : actions/checkout@v4
94+ - name : Dump the changelog
95+ run : .github/changelogtext.sh > '${{ github.ref_name }}.md'
96+ - name : Create GitHub Release
97+ env :
98+ GITHUB_TOKEN : ${{ github.token }}
99+ run : |
100+ latest_version=$(sed -r 's/__version__ = "(.*)"/\1/' ravenpackapi/version.py)
101+ gh release create '${{ github.ref_name }}' -F '${{ github.ref_name }}.md' --title "Version $latest_version" --repo '${{ github.repository }}'
You can’t perform that action at this time.
0 commit comments