Skip to content

Commit

Permalink
Update ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kea committed Dec 21, 2024
1 parent 9fef84f commit f892a7f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
on: push

jobs:
tests:
uses: ./.github/workflows/tests.yml
build:
name: Build distribution 📦
runs-on: ubuntu-latest
needs: tests

steps:
- uses: actions/checkout@v4
Expand All @@ -22,7 +25,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -42,7 +45,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -63,7 +66,7 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down Expand Up @@ -92,26 +95,26 @@ jobs:
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/certbot-nginx-unit

permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# publish-to-testpypi:
# name: Publish Python 🐍 distribution 📦 to TestPyPI
# needs:
# - build
# runs-on: ubuntu-latest
#
# environment:
# name: testpypi
# url: https://test.pypi.org/p/certbot-nginx-unit
#
# permissions:
# id-token: write
#
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Tests

on: [push]
on: [workflow_call]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion certbot_nginx_unit/tests/configurator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_empty_configuration(self, unitc_mock):
installer.deploy_cert("domain", "cert.pem", cert_file.name, "chain_path", cert_file.name)

expected_msg = "No '*:80' default listeners configured"
self.assertEquals(str(ctx.exception), expected_msg)
self.assertEqual(str(ctx.exception), expected_msg)

@mock.patch('certbot_nginx_unit.unitc')
def test_only_80_listener_configuration(self, unitc_mock):
Expand Down

0 comments on commit f892a7f

Please sign in to comment.