Skip to content
67 changes: 67 additions & 0 deletions .github/workflows/jfrog-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Publish to JFrog"

on:
push:
branches:
- 'li-0.11'

Comment thread
robreeves marked this conversation as resolved.
permissions:
contents: write

jobs:
tag:
Comment thread
robreeves marked this conversation as resolved.
Outdated
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.get-version.outputs.VERSION }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install UV
uses: astral-sh/setup-uv@v7

- name: Get initial version from pyproject.toml
id: initial-version
run: echo "VERSION=$(uv version --short)" >> "$GITHUB_OUTPUT"

- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.69.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
INITIAL_VERSION: ${{ steps.initial-version.outputs.VERSION }}

- name: Get the latest tag
id: get-version
run: |
latest_tag=$(git describe --tags --abbrev=0)
Comment thread
robreeves marked this conversation as resolved.
VERSION=${latest_tag#v}
echo "VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Publishing version ${VERSION}"

build:
needs: tag
uses: ./.github/workflows/pypi-build-artifacts.yml
with:
VERSION: ${{ needs.tag.outputs.VERSION }}

publish:
name: Publish to JFrog Artifactory
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all the artifacts
uses: actions/download-artifact@v7
with:
merge-multiple: true
path: dist/

- name: Publish to JFrog Artifactory PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://linkedin.jfrog.io/artifactory/api/pypi/openhouse-pypi
user: ${{ secrets.JFROG_USERNAME }}
password: ${{ secrets.JFROG_PYPI_API_TOKEN }}
verbose: true