|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | test: |
13 | | - name: Test and build django-saml2-auth |
| 13 | + name: Test django-saml2-auth |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 | strategy: |
16 | 16 | matrix: |
@@ -55,17 +55,40 @@ jobs: |
55 | 55 | with: |
56 | 56 | github-token: ${{ secrets.GITHUB_TOKEN }} |
57 | 57 | path-to-lcov: ./coverage.lcov |
| 58 | + build: |
| 59 | + name: Build and Push django-saml2-auth to PyPI |
| 60 | + runs-on: ubuntu-latest |
| 61 | + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} |
| 62 | + needs: test |
| 63 | + env: |
| 64 | + python-version: "3.10" |
| 65 | + poetry-version: "1.8.3" |
| 66 | + steps: |
| 67 | + - name: Checkout 🛎️ |
| 68 | + uses: actions/checkout@v4 |
| 69 | + - name: Set up Python 🐍 |
| 70 | + uses: actions/setup-python@v5 |
| 71 | + with: |
| 72 | + python-version: ${{ env.python-version }} |
| 73 | + - name: Install Poetry |
| 74 | + |
| 75 | + with: |
| 76 | + poetry-version: ${{ env.poetry-version }} |
| 77 | + - name: Install xmlsec1 📦 |
| 78 | + run: sudo apt-get install xmlsec1 |
| 79 | + - name: Install dependencies 📦 |
| 80 | + run: | |
| 81 | + python -m pip install poetry |
| 82 | + poetry install --with dev |
| 83 | + poetry self add "poetry-dynamic-versioning[plugin]" |
58 | 84 | - name: Generate CycloneDX SBOM artifacts 📃 |
59 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' |
60 | 85 | run: | |
61 | 86 | poetry run cyclonedx-py poetry --all-extras --of JSON -o django-saml2-auth-${{ github.ref_name }}.cyclonedx.json |
62 | 87 | - name: Build and publish package to PyPI 🎉 |
63 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' |
64 | 88 | run: | |
65 | 89 | poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} |
66 | 90 | poetry publish --build --skip-existing |
67 | 91 | - name: Create release and add artifacts 🚀 |
68 | | - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' |
69 | 92 | uses: softprops/action-gh-release@v2 |
70 | 93 | with: |
71 | 94 | files: | |
|
0 commit comments