diff --git a/.github/workflows/jfrog-publish.yml b/.github/workflows/jfrog-publish.yml new file mode 100644 index 00000000..63b4695d --- /dev/null +++ b/.github/workflows/jfrog-publish.yml @@ -0,0 +1,74 @@ +name: "Publish to JFrog" + +on: + push: + branches: + - 'li-0.11' + +concurrency: + group: jfrog-publish-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: read + +jobs: + tag: + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + VERSION: ${{ steps.get-version.outputs.VERSION }} + steps: + - name: Checkout repository + 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) + 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 diff --git a/pyproject.toml b/pyproject.toml index 7d754d32..b7342abf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. [project] -name = "pyiceberg" +name = "li-pyiceberg" version = "0.11.1" description = "Apache Iceberg is an open table format for huge analytic datasets" authors = [{ name = "Apache Software Foundation", email = "dev@iceberg.apache.org" }] diff --git a/tests/test_version.py b/tests/test_version.py index dcaa3f07..41dc3686 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -21,7 +21,7 @@ def test_version_format() -> None: from importlib import metadata - installed_version = metadata.version("pyiceberg") + installed_version = metadata.version("li-pyiceberg") assert __version__ == installed_version, ( f"The installed version ({installed_version}) does not match the current codebase version ({__version__})."