Skip to content

Commit

Permalink
Merge pull request #19 from timmyb824/ci/refactor-release-job
Browse files Browse the repository at this point in the history
  • Loading branch information
timmyb824 authored Aug 21, 2023
2 parents b11dcc0 + f8cf1be commit ea76682
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,33 @@ jobs:
run: |
git config user.name github-actions
git config user.email [email protected]
poetry run semantic-release version
OUTPUT=$(poetry run semantic-release version)
echo "$OUTPUT"
echo "name=RELEASE_OUTPUT" >> "$GITHUB_OUTPUT"
poetry run semantic-release changelog
poetry run semantic-release publish
# Unable to use at the moment due to the python version used by the action
# - name: Run Python Semantic Release
# id: release
# uses: python-semantic-release/python-semantic-release@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Check release output and terminate if no new version
shell: bash
if: contains(steps.release.outputs.RELEASE_OUTPUT, 'No release will be made,') && contains(steps.release.outputs.RELEASE_OUTPUT, 'has already been released!')
run: |
echo "No new version to release. Ending workflow."
exit 0
- name: Publish to TestPyPI
id: test_publish
if: steps.release.outcome == 'success'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Test install from TestPyPI
if: steps.test_publish.outcome == 'success'
Expand All @@ -130,7 +142,3 @@ jobs:
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.test_install.outcome == 'success'
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://upload.pypi.org/legacy/
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ allowed_tags = [
"style",
"refactor",
"test",
":boom:",
]
major_tags = [":boom:"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
patch_tags = ["fix", "perf", "style", "docs", "ci", "test"]

[tool.semantic_release]
version_toml = [
Expand Down

0 comments on commit ea76682

Please sign in to comment.