From 75e732ed0a715029f0bbb76461a8872753f9558a Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Thu, 19 Sep 2024 20:44:58 -0700 Subject: [PATCH] Fix up our publishing process to publish keras-hub and keras-nlp --- .github/workflows/nightly.yml | 9 +++-- .github/workflows/publish-hub-to-pypi.yml | 43 ----------------------- .github/workflows/publish-to-pypi.yml | 10 ++++-- 3 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/publish-hub-to-pypi.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 686421fe00..ed9a406b84 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -41,9 +41,14 @@ jobs: - name: Build wheel file run: | python pip_build.py --nightly - - name: Publish to PyPI + - name: Publish KerasHub nightly to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + password: ${{ secrets.PYPI_NIGHTLY_API_TOKEN_HUB }} + verbose: true + - name: Publish KerasHub nightly to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: keras-nlp/dist/ password: ${{ secrets.PYPI_NIGHTLY_API_TOKEN }} - packages-dir: dist/ verbose: true diff --git a/.github/workflows/publish-hub-to-pypi.yml b/.github/workflows/publish-hub-to-pypi.yml deleted file mode 100644 index 838ca9b698..0000000000 --- a/.github/workflows/publish-hub-to-pypi.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Publish Hub to PyPI - -on: - push: - branches: - - keras-hub - -permissions: - contents: read - -jobs: - build-and-publish: - name: Build and publish Hub to PyPI - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 - - name: Get pip cache dir - id: pip-cache - run: | - python -m pip install --upgrade pip setuptools - echo "::set-output name=dir::$(pip cache dir)" - - name: pip cache - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - name: Install dependencies - run: | - pip install -r requirements.txt --progress-bar off - - name: Build a binary wheel and a source tarball - run: >- - python pip_build.py - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN_HUB }} diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 9d5ee35f78..52d690af49 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -33,9 +33,15 @@ jobs: - name: Build a binary wheel and a source tarball run: >- python pip_build.py - - name: Publish distribution to PyPI + - name: Publish KerasHub to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ + password: ${{ secrets.PYPI_API_TOKEN_HUB }} + verbose: true + - name: Publish KerasNLP to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: keras-nlp/dist/ password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true