1
1
name : Update Version, Test, Publish to PyPI, and Upload Release Artifacts
2
-
3
2
on :
4
3
release :
5
4
types : [created]
6
-
7
5
jobs :
8
6
build-test-publish-upload :
9
7
runs-on : ubuntu-latest
@@ -40,22 +38,19 @@ jobs:
40
38
# retrieve the ambient OIDC token
41
39
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
42
40
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
43
- oidc_token=$(jq -r '.value' <<< "${resp}")
44
-
41
+ oidctoken=$(jq -r '.value' <<< "${resp}")
45
42
# exchange the OIDC token for an API token
46
- resp=$(curl -X POST https://pypi.org/_ /oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
43
+ resp=$(curl -X POST https://pypi.org//oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
47
44
api_token=$(jq -r '.token' <<< "${resp}")
48
-
49
45
# mask the newly minted API token, so that we don't accidentally leak it
50
46
echo "::add-mask::${api_token}"
51
-
52
47
# see the next step in the workflow for an example of using this step output
53
48
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
54
49
- name : Publish to PyPI
55
50
env :
56
51
PYPI_API_TOKEN : ${{ steps.mint-token.outputs.api-token }}
57
52
run : |
58
- hatch publish -u __token__ -a $PYPI_API_TOKEN
53
+ hatch publish -u token -a $PYPI_API_TOKEN
59
54
- name : Upload Release Asset
60
55
uses : ncipollo/release-action@v1
61
56
with :
@@ -71,18 +66,15 @@ jobs:
71
66
PACKAGE_NAME="mesa_frames"
72
67
CURRENT_VERSION=$(hatch version)
73
68
pip install $PACKAGE_NAME==$CURRENT_VERSION
74
- python -c "import mesa_frames; print(mesa_frames.__version__)"
75
-
69
+ python -c "import mesa_frames; print(mesa_frames.version)"
76
70
# Bump to next development version
77
71
hatch version patch
78
72
hatch version dev
79
-
80
73
# Get the new version
81
74
NEW_VERSION=$(hatch version)
82
-
83
75
# Commit and push the version bump
84
76
git config user.name github-actions
85
77
git config user.email github-actions@github.com
86
- git add mesa-frames/__init__ .py
78
+ git add mesa-frames/init .py
87
79
git commit -m "Bump version to $NEW_VERSION [skip ci]"
88
80
git push
0 commit comments