From 98191cddaad5b7e8d72f053026f580ac28f3d9f4 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Fri, 13 Sep 2024 17:03:18 -0500 Subject: [PATCH 1/2] Update build test --- .github/workflows/build-test.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 43a2a5f..f8530dc 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,27 +1,27 @@ name: Build Test on: [push, pull_request] jobs: - pypi-publish: - name: Test Build Process + build: + name: Build Distribution runs-on: ubuntu-latest - environment: release - permissions: - id-token: write - strategy: - matrix: - python-version: [3.12] + environment: + name: build steps: - name: Checkout repo - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip pip install --upgrade setuptools wheel - - name: Install pypa/build - run: python3 -m pip install build --user - - name: Build + python -m pip install build --user + - name: Build a binary wheel and a source tarball run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ From e532e5d3106f42d7a0831698720d19b5a16bfa1b Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Fri, 13 Sep 2024 17:03:49 -0500 Subject: [PATCH 2/2] Update pypi publish job --- .github/workflows/pypi.yml | 68 ++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index b3943ee..e69f076 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -3,33 +3,67 @@ on: release: types: released jobs: - pypi-publish: - name: Upload Release to PyPI + + build: + name: Build Distribution runs-on: ubuntu-latest environment: release - permissions: - id-token: write - strategy: - matrix: - python-version: [3.12] steps: - name: Checkout repo - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip pip install --upgrade setuptools wheel - - name: Build + python -m pip install build --user + - name: Build a binary wheel and a source tarball run: python -m build - #- name: Publish package to TestPyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # repository_url: https://test.pypi.org/legacy/ - # skip_existing: true + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/netbox-config-backup + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + publish-to-pypi: + name: Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/netbox-config-backup + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: