-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Separate the Build and Deploy job (#349)
* feat: Separate the Build and Deploy job * Change syntax
- Loading branch information
Showing
1 changed file
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
|
||
jobs: | ||
test: | ||
name: Test and build django-saml2-auth | ||
name: Test django-saml2-auth | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -55,17 +55,40 @@ jobs: | |
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ./coverage.lcov | ||
build: | ||
name: Build and Push django-saml2-auth to PyPI | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | ||
needs: test | ||
env: | ||
python-version: "3.10" | ||
poetry-version: "1.8.3" | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 🐍 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.python-version }} | ||
- name: Install Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ env.poetry-version }} | ||
- name: Install xmlsec1 📦 | ||
run: sudo apt-get install xmlsec1 | ||
- name: Install dependencies 📦 | ||
run: | | ||
python -m pip install poetry | ||
poetry install --with dev | ||
poetry self add "poetry-dynamic-versioning[plugin]" | ||
- name: Generate CycloneDX SBOM artifacts 📃 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' | ||
run: | | ||
poetry run cyclonedx-py poetry --all-extras --of JSON -o django-saml2-auth-${{ github.ref_name }}.cyclonedx.json | ||
- name: Build and publish package to PyPI 🎉 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} | ||
poetry publish --build --skip-existing | ||
- name: Create release and add artifacts 🚀 | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.versions.pythonVersion }} == '3.10' && ${{ matrix.versions.djangoVersion }} == '4.2.16' | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
|