-
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.35 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CI/CD pipeline
on:
push:
branches:
- "*"
jobs:
tests:
uses: NextGenContributions/cicd-pipeline/.github/workflows/test.yml@main
with:
project_name: django-ninja-crudl
release:
uses: NextGenContributions/cicd-pipeline/.github/workflows/release.yml@main
with:
release_branch: main
needs: tests
permissions:
id-token: write
contents: write
publish-to-testpypi:
# TODO(phuongfi91): Revisit this once Reusable Workflow is supported for Trusted Publishing
# Ref: https://github.com/pypi/warehouse/issues/11096
# Workflow: NextGenContributions/cicd-pipeline/.github/workflows/publish-pypi.yml@main
name: Publish Python 🐍 distribution 📦 to TestPyPI
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.released == 'true' }}
needs:
- release
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
environment:
name: testpypi
url: ${{ format('https://test.pypi.org/p/{0}', 'django-ninja-crudl') }}
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/