Skip to content

Commit d2ff3a0

Browse files
authored
feat: Separate the Build and Deploy job (#349)
* feat: Separate the Build and Deploy job * Change syntax
1 parent bd1513a commit d2ff3a0

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13-
name: Test and build django-saml2-auth
13+
name: Test django-saml2-auth
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
@@ -55,17 +55,40 @@ jobs:
5555
with:
5656
github-token: ${{ secrets.GITHUB_TOKEN }}
5757
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+
uses: abatilo/[email protected]
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]"
5884
- 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'
6085
run: |
6186
poetry run cyclonedx-py poetry --all-extras --of JSON -o django-saml2-auth-${{ github.ref_name }}.cyclonedx.json
6287
- 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'
6488
run: |
6589
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
6690
poetry publish --build --skip-existing
6791
- 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'
6992
uses: softprops/action-gh-release@v2
7093
with:
7194
files: |

0 commit comments

Comments
 (0)