Skip to content

Commit f13ec64

Browse files
committed
chore: only publish on new release
1 parent b1d1d6b commit f13ec64

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,24 @@ jobs:
5656
poetry run black --check beet_observer
5757
poetry run isort --check-only beet_observer
5858
- name: Release
59+
id: release
5960
if: |
6061
github.repository == 'BPR02/Observer'
6162
&& github.event_name == 'push'
6263
&& github.ref == 'refs/heads/main'
64+
uses: python-semantic-release/[email protected]
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
git_committer_name: "github-actions"
68+
git_committer_email: "[email protected]"
69+
- name: Publish
70+
if: steps.release.outputs.released == 'true'
6371
env:
6472
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6573
TWINE_USERNAME: __token__
6674
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
6775
run: |
6876
git config --global user.name "github-actions"
6977
git config --global user.email "[email protected]"
70-
poetry run semantic-release version
7178
poetry run twine upload --verbose dist/*
7279
poetry run semantic-release publish

0 commit comments

Comments
 (0)