From e701c62fb8050735819fbe885b4b046c371312c3 Mon Sep 17 00:00:00 2001 From: Hitesh Malhotra <68507331+CodeWithHitesh@users.noreply.github.com> Date: Tue, 15 Jul 2025 00:07:09 +0530 Subject: [PATCH] ci: publish package to artifactory --- .github/workflows/release.yml | 20 ++++++++++++++++++++ README.md | 2 ++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cd90ca..9c93a6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,3 +27,23 @@ jobs: tag_prefix: v - name: Echo created tag run: echo "Created ${{ steps.tagger.outputs.new_tag }}" + - name: Set up Python + if: steps.tagger.outputs.new_tag != '' + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install build dependencies + if: steps.tagger.outputs.new_tag != '' + run: | + python -m pip install --upgrade pip + pip install build twine + - name: Build package + if: steps.tagger.outputs.new_tag != '' + run: python -m build + - name: Publish to Artifactory + if: steps.tagger.outputs.new_tag != '' + env: + TWINE_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + TWINE_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + TWINE_REPOSITORY_URL: ${{ secrets.ARTIFACTORY_URL }} + run: twine upload dist/* diff --git a/README.md b/README.md index 86fc2fd..acfdeb3 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ After the tests pass, the PR can be merged once it has been approved. Merged commits on `master` are scanned for Conventional Commit messages. A separate workflow uses a public GitHub Action to calculate the next semantic version and automatically push the corresponding `vX.Y.Z` tag. +Whenever a tag is created, another step builds the package and publishes it to +the configured Artifactory PyPI repository. ## License