@@ -10,6 +10,7 @@ permissions:
1010
1111jobs :
1212 release :
13+ if : github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
1314 runs-on : ubuntu-24.04
1415
1516 steps :
@@ -43,34 +44,20 @@ jobs:
4344 - name : List downloaded files
4445 run : |
4546 echo "Artifacts downloaded:"
46- find artifacts -type f -print
47+ find artifacts -type f -exec readlink -f {} \;
4748
48- - name : Publish wheel to GitHub PyPI
49+ - name : Create GitHub Release
4950 run : |
50- pip install twine
51-
52- # Create .pypirc
53- cat > ~/.pypirc <<EOF
54- [distutils]
55- index-servers =
56- github
57-
58- [github]
59- repository = https://pypi.pkg.github.com/${{ github.repository_owner }}
60- username = __token__
61- password = ${{ secrets.GITHUB_TOKEN }}
62- EOF
63-
64- # Upload wheels from artifacts
65- twine upload --repository github artifacts/**/*.whl
66-
67- - name : Create GitHub release
68- uses : softprops/action-gh-release@v2
69- with :
70- tag_name : v${{ steps.changelog.outputs.version }}
71- name : Release v${{ steps.changelog.outputs.version }}
72- files : |
73- artifacts/linux-amd64/**
74- artifacts/linux-arm64/**
51+ VERSION="${{ steps.changelog.outputs.version }}"
52+ VERSION="${VERSION%%-*}"
53+ echo "Creating release for version: ${VERSION}"
54+ TAG="v{VERSION}"
55+ gh release create "${TAG}" \
56+ --title "Release ${TAG}" \
57+ --notes "Automated release for version ${TAG}" \
58+ artifacts/linux-amd64/build/**
59+ artifacts/linux-amd64/dist/**
60+ artifacts/linux-arm64/build/**
61+ artifacts/linux-arm64/dist/**
7562 env :
76- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments