diff --git a/.github/workflows/cleanup_test_pypi.yml b/.github/workflows/cleanup_test_pypi.yml new file mode 100644 index 00000000000..afc1714a1e2 --- /dev/null +++ b/.github/workflows/cleanup_test_pypi.yml @@ -0,0 +1,25 @@ +name: Cleanup TestPyPi + +on: + workflow_call: + secrets: + TESTPYPI_API_TOKEN: + required: true + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pypi-cleanup + - name: Cleanup TestPyPi + env: + PYPI_CLEANUP_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} + run: pypi-cleanup --host https://test.pypi.org --package kolibri --leave-most-recent-only --username __token__ diff --git a/.github/workflows/release_kolibri.yml b/.github/workflows/release_kolibri.yml index 46733cddba1..e952394c29d 100644 --- a/.github/workflows/release_kolibri.yml +++ b/.github/workflows/release_kolibri.yml @@ -134,9 +134,15 @@ jobs: with: filename: ${{ needs.apk.outputs.apk-file-name }} release_id: ${{ github.event.release.id }} + test_pypi_cleanup: + name: Cleanup TestPyPi + needs: whl + uses: ./.github/workflows/cleanup_test_pypi.yml + secrets: + TESTPYPI_API_TOKEN: ${{ secrets.TESTPYPI_API_TOKEN }} test_pypi_upload: name: Upload to TestPyPi - needs: whl + needs: [whl, test_pypi_cleanup] uses: ./.github/workflows/pypi_upload.yml with: whl-file-name: ${{ needs.whl.outputs.whl-file-name }}