Skip to content

Commit

Permalink
build: patch release by default
Browse files Browse the repository at this point in the history
  • Loading branch information
francescopisu committed Sep 15, 2023
1 parent 159cbc1 commit b53a7ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
21 changes: 1 addition & 20 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,42 +73,23 @@ jobs:
run: |
git config user.name github-actions
git config user.email github-actions@github.com
poetry run semantic-release publish
- name: Check if semantic-release-python created a new release
id: check_new_release
run: |
latest_tag=$(git describe --abbrev=0 --tags)
previous_tag=$(git describe --abbrev=0 --tags $latest_tag^)
echo "Latest Tag: $latest_tag"
echo "Previous Tag: $previous_tag"
if [ "$latest_tag" != "$previous_tag" ]; then
echo "New Git tag detected"
echo "::set-output name=new_version::true"
else
echo "No new Git tag detected"
echo "::set-output name=new_version::false"
fi
poetry run semantic-release publish
- name: Publish to TestPyPi
if: steps.check_new_release.outputs.new_version == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Test install from TestPyPI
if: steps.check_new_release.outputs.new_version == 'true'
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
modelsight
- name: Publish to PyPI
if: steps.check_new_release.outputs.new_version == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ dist_path = "dist/" # where to put dists
upload_to_release = true # auto-create GitHub release
upload_to_pypi = false # don't auto-upload to PyPI
remove_dist = false # don't remove dists
patch_without_tag = false # patch release by default
patch_without_tag = true # patch release by default

0 comments on commit b53a7ad

Please sign in to comment.