-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
159cbc1
commit b53a7ad
Showing
2 changed files
with
2 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,42 +73,23 @@ jobs: | |
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
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__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters