7
7
description : " The version to release"
8
8
required : true
9
9
IS_PRE_RELEASE :
10
- description : " Whether this is a pre-release"
10
+ description : " It IS a pre-release"
11
11
required : true
12
12
default : false
13
13
type : boolean
21
21
env :
22
22
VERSION : ${{ inputs.VERSION }}
23
23
GH_TOKEN : ${{ github.token }}
24
+ SSH_AUTH_SOCK : /tmp/ssh_agent.sock
24
25
steps :
25
- - name : git clone develop
26
- uses : actions/checkout@v4
27
- with :
28
- ref : develop
29
-
30
- - name : Set up Python
26
+ - name : set up Python
31
27
uses : actions/setup-python@v4
32
28
with :
33
29
python-version : " 3.12"
@@ -37,53 +33,30 @@ jobs:
37
33
pip install --upgrade pip
38
34
pip install build twine hatch
39
35
40
- - name : upgrade version with hatch
41
- run : hatch version ${{ env.VERSION }}
42
-
43
- - name : build binary wheel and source tarball
44
- env :
45
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
46
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
47
- run : |
48
- python -m build
49
-
50
- - name : publish to TestPyPI
51
- env :
52
- TWINE_USERNAME : ${{ secrets.TESTPYPI_USERNAME }}
53
- TWINE_PASSWORD : ${{ secrets.TESTPYPI_PASSWORD }}
54
- run : twine upload --repository testpypi dist/*
55
-
56
- - name : publish to PyPI
57
- env :
58
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
59
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
60
- run : twine upload dist/*
61
-
62
36
- name : configure git with the bot credentials
63
- env :
64
- SSH_AUTH_SOCK : /tmp/ssh_agent.sock
65
37
run : |
66
38
mkdir -p ~/.ssh
67
39
ssh-keyscan github.com >> ~/.ssh/known_hosts
68
40
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
69
41
ssh-add - <<< "${{ secrets.NEXTMVBOT_SSH_KEY }}"
70
42
71
- echo "${{ secrets.NEXTMVBOT_SIGNING_KEY }}" > ~/.ssh/signing.key
72
- chmod 600 ~/.ssh/signing.key
73
-
74
43
git config --global user.name "nextmv-bot"
75
44
git config --global user.email "tech+gh-nextmv-bot@nextmv.io"
76
- git config --global url."git@github.com:".insteadOf "https://github.com/"
77
- git config --global gpg.format ssh
78
- git config --global user.signingkey ~/.ssh/signing.key
45
+
46
+ git clone git@github.com:nextmv-io/nextmv-py.git
47
+
48
+ - name : upgrade version with hatch
49
+ run : hatch version ${{ env.VERSION }}
50
+ working-directory : ./nextmv-py
79
51
80
52
- name : commit new version
81
53
run : |
82
54
git add nextmv/__about__.py
83
- git commit -S - m "Bump version to $VERSION"
55
+ git commit -m "Bump version to $VERSION"
84
56
git push
85
57
git tag $VERSION
86
58
git push origin $VERSION
59
+ working-directory : ./nextmv-py
87
60
88
61
- name : create release
89
62
run : |
92
65
PRERELEASE_FLAG="--prerelease"
93
66
fi
94
67
95
- gh release create -R nextmv-io/nextmv-py $VERSION \
68
+ gh release create $VERSION \
96
69
--verify-tag \
97
70
--generate-notes \
98
71
--title $VERSION $PRERELEASE_FLAG
72
+ working-directory : ./nextmv-py
73
+
74
+ - name : build binary wheel and source tarball
75
+ env :
76
+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
77
+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
78
+ run : python -m build
79
+ working-directory : ./nextmv-py
80
+
81
+ - name : publish to TestPyPI
82
+ env :
83
+ TWINE_USERNAME : ${{ secrets.TESTPYPI_USERNAME }}
84
+ TWINE_PASSWORD : ${{ secrets.TESTPYPI_PASSWORD }}
85
+ run : twine upload --repository testpypi dist/*
86
+ working-directory : ./nextmv-py
87
+
88
+ - name : publish to PyPI
89
+ env :
90
+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
91
+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
92
+ run : twine upload dist/*
93
+ working-directory : ./nextmv-py
0 commit comments