File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Create release & publish to PyPI
2+ # If ran manually, e.g. with ref set to "refs/tags/v1.2.3", set the run name to "Publish refs/tags/v1.2.3".
3+ run-name : ${{ inputs.ref && format('Publish {0}', inputs.ref) || null }}
4+
5+ on :
6+ push :
7+ branches :
8+ - main
9+ # Run daily to keep the release PR date current
10+ schedule :
11+ - cron : ' 1 0 * * *'
12+ workflow_dispatch :
13+ inputs :
14+ ref :
15+ description : " The branch, tag or SHA to publish."
16+ required : true
17+ type : string
18+
19+ jobs :
20+ release-please :
21+ uses : City-of-Helsinki/.github/.github/workflows/release-please.yml@main
22+ permissions :
23+ contents : write
24+ pull-requests : write
25+ with :
26+ include-component-in-tag : false
27+
28+ build :
29+ needs :
30+ - release-please
31+ uses : City-of-Helsinki/.github/.github/workflows/build-python-dists.yml@main
32+ with :
33+ ref : ${{ inputs.ref }}
34+ # Run build job if a release was created or a ref was specified (i.e. workflow was invoked manually)
35+ if : ${{ needs.release-please.outputs.release_created || inputs.ref }}
36+
37+ publish-to-pypi :
38+ name : Publish to PyPI
39+ runs-on : ubuntu-latest
40+ needs :
41+ - build
42+ # Run publish job if an artifact was uploaded
43+ if : ${{ needs.build.outputs.artifact_name }}
44+ environment :
45+ name : pypi
46+ url : https://pypi.org/p/django-ilmoitin
47+ permissions :
48+ id-token : write # mandatory for trusted publishing
49+ steps :
50+ - name : Download all the dists
51+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
52+ with :
53+ name : ${{ needs.build.outputs.artifact_name }}
54+ path : dist/
55+ - name : Publish distribution to PyPI
56+ uses : pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments