15
15
- major
16
16
- minor
17
17
- patch
18
+ - alpha
19
+ - beta
20
+ - rc
21
+ - rev
22
+ - post
18
23
19
24
jobs :
20
25
25
30
new_tag : ${{ steps.set_var.outputs.new_tag }}
26
31
permissions :
27
32
contents : write # IMPORTANT: mandatory for making GitHub Releases
33
+ id-token : write # IMPORTANT: mandatory for trusted publishing
28
34
steps :
29
35
- uses : actions/checkout@v4
30
36
- name : Set up Python
@@ -35,54 +41,32 @@ jobs:
35
41
run : >-
36
42
python3 -m
37
43
pip install
38
- poetry
44
+ hatchling uv
39
45
--user
40
46
- name : update version tag in pyproject.toml
41
47
id : set_var
42
- run : |
43
- poetry version ${{ github.event.inputs.version_bump }}
44
- echo "new_tag=$(poetry version --short )" >> $GITHUB_OUTPUT
48
+ run : |
49
+ hatchling version ${{ github.event.inputs.version_bump }}
50
+ echo "new_tag=$(hatchling version)" >> $GITHUB_OUTPUT
45
51
git config --global user.email "[email protected] "
46
52
git config --global user.name "github robot"
47
53
git commit -am "update package build version gha"
48
54
git push origin main
49
55
50
56
- name : Build a binary wheel and a source tarball
51
- run : poetry build
57
+ run : uv build && uv publish
52
58
- name : Store the distribution packages
53
59
uses : actions/upload-artifact@v3
54
60
with :
55
61
name : python-package-distributions
56
62
path : dist/
57
- publish-to-pypi :
58
- name : >-
59
- Publish Python 🐍 distribution 📦 to PyPI
60
- needs :
61
- - build
62
- runs-on : ubuntu-latest
63
- environment :
64
- name : release
65
- url : https://pypi.org/p/MCP_Bridge # Replace <package-name> with your PyPI project name
66
- permissions :
67
- id-token : write # IMPORTANT: mandatory for trusted publishing
68
63
69
- steps :
70
- - name : Download all the dists
71
- uses : actions/download-artifact@v3
72
- with :
73
- name : python-package-distributions
74
- path : dist/
75
- - name : Publish distribution 📦 to PyPI
76
- uses : pypa/gh-action-pypi-publish@release/v1
77
- with :
78
- skip-existing : true
79
64
80
65
github-release :
81
66
name : >-
82
67
Sign the Python 🐍 distribution 📦 with Sigstore
83
68
and upload them to GitHub Release
84
69
needs :
85
- - publish-to-pypi
86
70
- build
87
71
runs-on : ubuntu-latest
88
72
@@ -96,13 +80,13 @@ jobs:
96
80
uses : actions/download-artifact@v3
97
81
with :
98
82
name : python-package-distributions
99
- path : dist/
83
+ path : .
100
84
- name : Sign the dists with Sigstore
101
85
102
86
with :
103
87
inputs : >-
104
- ./dist/ *.tar.gz
105
- ./dist/ *.whl
88
+ ./*.tar.gz
89
+ ./*.whl
106
90
- name : Create GitHub Release
107
91
env :
108
92
GITHUB_TOKEN : ${{ github.token }}
111
95
gh release create
112
96
'${{ needs.build.outputs.new_tag }}'
113
97
--repo '${{ github.repository }}'
114
- --notes ""
98
+ --generate- notes
115
99
- name : Upload artifact signatures to GitHub Release
116
100
env :
117
101
GITHUB_TOKEN : ${{ github.token }}
@@ -120,21 +104,26 @@ jobs:
120
104
# sigstore-produced signatures and certificates.
121
105
run : >-
122
106
gh release upload
123
- '${{ needs.build.outputs.new_tag }}' dist/**
107
+ '${{ needs.build.outputs.new_tag }}' ./*.tar.gz ./*.whl ./*.tar.gz.sigstore.json ./*.whl.sigstore.json
124
108
--repo '${{ github.repository }}'
125
109
126
110
push-store-image :
127
111
permissions : write-all
128
112
runs-on : ubuntu-latest
113
+ needs :
114
+ - build
129
115
steps :
130
116
- name : Login to GitHub Container Registry
131
117
uses : docker/login-action@v2
132
118
with :
133
119
registry : ghcr.io
134
120
username : ${{ github.actor }}
135
121
password : ${{ secrets.GITHUB_TOKEN }}
136
-
122
+ - name : Checkout code
123
+ uses : actions/checkout@v4
137
124
- name : ' Build images'
138
125
run : |
139
126
RELEASE=${{ needs.build.outputs.new_tag }} \
140
127
docker buildx bake mcp-bridge -f docker-bake.hcl --push
128
+
129
+
0 commit comments