Comment-out deployment to PyPI for testing #49
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-n-deploy | ||
on: | ||
push: | ||
tags: | ||
- "v*.*" # Trigger on push with tags matching a version, e.g.: v1.0, v0.1.5 | ||
jobs: | ||
deploy-test-pypi: | ||
name: Deploy to Test PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- 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 setuptools wheel twine | ||
- name: Build | ||
run: python setup.py sdist bdist_wheel | ||
- name: Twine check | ||
run: twine check dist/* | ||
- name: Upload package artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package-artifacts | ||
path: dist/ | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@v1 | ||
with: | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Sleep for 120 seconds to give Test PyPI time to update the search index | ||
run: sleep 120 | ||
verify-test-pypi: | ||
name: Install from Test PyPI | ||
runs-on: ubuntu-latest | ||
needs: [deploy-test-pypi] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Get release version | ||
id: release_version | ||
run: | | ||
echo "version=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" | ||
echo ${{ steps.release_version.outputs.version }} | ||
- name: Install torch-lr-finder ${{ steps.release_version.outputs.version }} from Test PyPI | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install \ | ||
--index-url https://test.pypi.org/simple/ \ | ||
--extra-index-url https://pypi.org/simple \ | ||
torch-lr-finder==${{ steps.release_version.outputs.version }} | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: [verify-test-pypi] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Create draft release | ||
run: | | ||
gh release create ${{ github.ref }} \ | ||
--title "Release ${{ github.ref }}" \ | ||
--generate-notes \ | ||
--draft | ||
deploy-pypi: | ||
name: Deploy to PyPI | ||
runs-on: ubuntu-latest | ||
needs: [verify-test-pypi] | ||
steps: | ||
- name: Download package artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: package-artifacts | ||
path: dist/ | ||
# - name: Publish package to PyPI | ||
# uses: pypa/gh-action-pypi-publish@v1 | ||
# with: | ||
# password: ${{ secrets.pypi_password }} |