From 7e54b5360189a7534b873eff1ad4a808cf8c1513 Mon Sep 17 00:00:00 2001 From: hinxcode Date: Sat, 13 Jul 2024 01:36:04 -0700 Subject: [PATCH 1/4] feat: Add version number --- src/autora/doc/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/autora/doc/__init__.py b/src/autora/doc/__init__.py index e69de29..8dee4bf 100644 --- a/src/autora/doc/__init__.py +++ b/src/autora/doc/__init__.py @@ -0,0 +1 @@ +from ._version import __version__ From 4faf21441e1d738b246f719c1bbb154bdc34aa29 Mon Sep 17 00:00:00 2001 From: hinxcode Date: Sun, 14 Jul 2024 14:23:44 -0700 Subject: [PATCH 2/4] chore: Update publish action --- .github/workflows/publish-to-pypi.yml | 74 +++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a25fc7d..7a8306e 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -16,10 +16,8 @@ permissions: contents: read jobs: - deploy: + build-artifact: runs-on: ubuntu-latest - permissions: - id-token: write steps: - uses: actions/checkout@v3 - name: Set up Python @@ -31,6 +29,74 @@ jobs: python -m pip install --upgrade pip pip install build - name: Build package - run: python -m build + run: | + python -m build + echo "" + echo "Generated files:" + ls -lh dist/ + - uses: actions/upload-artifact@v3 + with: + name: releases + path: dist + test-built-dist: + name: Test package + needs: build-artifact + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - uses: actions/download-artifact@v3 + with: + name: releases + path: dist + - name: List contents of built dist + run: | + ls -ltrh + ls -ltrh dist + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + verbose: true + skip_existing: true + - name: Check pypi packages + id: check_pkg + run: | + # Install local wheel to get the version number + pip install dist/autora_doc*.whl + latest_version="$(python -c 'from autora import doc; print(doc.__version__)')";export latest_version + echo "latest_version=$latest_version" >> $GITHUB_OUTPUT + echo "=== Got version $latest_version from local wheel install ===" + python -m pip uninstall --yes autora-doc + sleep 5 + + python -m pip install --upgrade pip + echo "=== Testing wheel file ===" + # Install wheel to get dependencies and check import + python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre autora-doc==$latest_version + echo "=== Done testing wheel file ===" + echo "=== Testing source tar file ===" + # Install tar gz and check import + python -m pip uninstall --yes autora-doc + python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre --no-binary=autora-doc autora-doc==$latest_version + python -c "from autora import doc; print(doc.__version__)" + echo "=== Done testing source tar file ===" + outputs: + package-version: ${{steps.check_pkg.outputs.latest_version}} + publish: + name: Publish distribution 📦 to PyPI + needs: test-built-dist + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: releases + path: dist - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 From ffb5077e49876e59c7d819526862e22bf42d9038 Mon Sep 17 00:00:00 2001 From: hinxcode Date: Sun, 14 Jul 2024 14:52:01 -0700 Subject: [PATCH 3/4] chore: Add job's name --- .github/workflows/publish-to-pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 7a8306e..6eb52de 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -17,6 +17,7 @@ permissions: jobs: build-artifact: + name: Build package runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 40919972fd72a471f10d5b353c8b09d60cc4ce11 Mon Sep 17 00:00:00 2001 From: hinxcode Date: Tue, 4 Mar 2025 22:17:54 -0800 Subject: [PATCH 4/4] chore: Update comments and echos --- .github/workflows/publish-to-pypi.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 6eb52de..add4ed7 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -60,6 +60,7 @@ jobs: - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: + # TODO: Set up TEST_PYPI_API_TOKEN secret in GitHub Actions settings password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository-url: https://test.pypi.org/legacy/ verbose: true @@ -68,6 +69,7 @@ jobs: id: check_pkg run: | # Install local wheel to get the version number + echo "=== Testing wheel file ===" pip install dist/autora_doc*.whl latest_version="$(python -c 'from autora import doc; print(doc.__version__)')";export latest_version echo "latest_version=$latest_version" >> $GITHUB_OUTPUT @@ -76,10 +78,10 @@ jobs: sleep 5 python -m pip install --upgrade pip - echo "=== Testing wheel file ===" + echo "=== Testing Test PyPi installation ===" # Install wheel to get dependencies and check import python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre autora-doc==$latest_version - echo "=== Done testing wheel file ===" + echo "=== Done testing Test PyPi file ===" echo "=== Testing source tar file ===" # Install tar gz and check import python -m pip uninstall --yes autora-doc