Skip to content

Commit 2ee4d28

Browse files
fix: update semantic release pipeline configuration
1 parent c36f5b2 commit 2ee4d28

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ jobs:
7272
permissions:
7373
id-token: write
7474
contents: write
75+
issues: write
76+
pull-requests: write
7577

7678
steps:
7779
- uses: actions/checkout@v4
7880
with:
7981
fetch-depth: 0
82+
token: ${{ secrets.GITHUB_TOKEN }}
8083

8184
- name: Set up Python
8285
uses: actions/setup-python@v5
@@ -96,17 +99,22 @@ jobs:
9699

97100
- name: Python Semantic Release
98101
id: semantic-release
99-
uses: python-semantic-release/python-semantic-release@v9.1.1
100-
with:
101-
github_token: ${{ secrets.GITHUB_TOKEN }}
102-
103-
- name: Publish release to GitHub
104-
if: steps.semantic-release.outputs.released == 'true'
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107102
run: |
108-
echo "Released version ${{ steps.semantic-release.outputs.version }}"
109-
gh release create v${{ steps.semantic-release.outputs.version }} \
110-
--title "v${{ steps.semantic-release.outputs.version }}" \
111-
--notes "${{ steps.semantic-release.outputs.release_notes }}" \
112-
dist/*
103+
git config --global user.name "semantic-release"
104+
git config --global user.email "semantic-release@users.noreply.github.com"
105+
# Debug information
106+
echo "Current git status:"
107+
git status
108+
echo "Current branch:"
109+
git branch
110+
# Run semantic release with verbose output
111+
poetry run semantic-release --verbose version
112+
# Only publish if version command succeeded
113+
if [ $? -eq 0 ]; then
114+
poetry run semantic-release --verbose publish
115+
else
116+
echo "Version command failed, skipping publish"
117+
exit 1
118+
fi
119+
env:
120+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,19 @@ changelog_file = "CHANGELOG.md"
4040
build_command = "poetry build"
4141
dist_path = "dist/"
4242
upload_to_pypi = false
43-
upload_to_repository = false
4443
upload_to_release = true
4544
commit_message = "chore(release): {version} [skip ci]"
4645
commit_author = "semantic-release <semantic-release@users.noreply.github.com>"
4746
major_on_zero = false
4847
tag_format = "v{version}"
4948

49+
[tool.semantic_release.remote.token]
50+
env = "GH_TOKEN"
51+
52+
[tool.semantic_release.branches.main]
53+
match = "main"
54+
prerelease = false
55+
5056
[tool.black]
5157
line-length = 88
5258
target-version = ["py312"]

0 commit comments

Comments
 (0)