Skip to content

Commit

Permalink
[ci][clean] Removing test.pypi.org deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Feb 5, 2024
1 parent e9202e4 commit fc7df64
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions .github/workflows/build_and_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,22 @@ jobs:
with:
fetch-depth: 0

# Fetching dependencies from test.pypi,org or pypi.org depending on the package destination:
# tag -> pypi.org, not tag -> test.pypi.org
- name: Build Ledgered Python package
run: |
pip install --upgrade pip build twine
if [[ ${{ github.ref }} == "refs/tags/"* ]]; \
then \
python -m build; \
pip install .
else \
PIP_EXTRA_INDEX_URL=https://test.pypi.org/simple/ python -m build; \
pip install --extra-index-url https://test.pypi.org/simple/ .
fi
python -m build; \
pip install .
python -m twine check dist/*
echo "TAG_VERSION=$(python -c 'from ledgered import __version__; print(__version__)')" >> "$GITHUB_ENV"
- name: Display current status
run: |
echo "Current status is:"
if [[ ${{ github.ref }} == "refs/tags/"* ]]; \
then \
echo "- Triggered from tag, will be deployed on pypi.org"; \
else \
echo "- Not triggered from tag, will be deployed on test.pypi.org"; \
if [[ ${{ github.ref }} == "refs/tags/"* ]];
then
echo "- Triggered from tag, package will be a release";
else
echo "- Not triggered from tag, package will be a pre-release";
fi
echo "- Tag version: ${{ env.TAG_VERSION }}"
Expand All @@ -94,7 +86,7 @@ jobs:
fi
- name: Publish Python package on pypi.org
if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
if: success() && github.event_name == 'push'
run: python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
Expand All @@ -107,15 +99,7 @@ jobs:
with:
automatic_release_tag: "v${{ env.TAG_VERSION }}"
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
prerelease: false
files: |
LICENSE
dist/
- name: Publish Python package on test.pypi.org
if: success() && github.event_name == 'push'
run: python -m twine upload --repository testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PUBLIC_API_TOKEN }}
TWINE_NON_INTERACTIVE: 1

0 comments on commit fc7df64

Please sign in to comment.