File tree Expand file tree Collapse file tree 2 files changed +52
-56
lines changed Expand file tree Collapse file tree 2 files changed +52
-56
lines changed Original file line number Diff line number Diff line change 8181 uses : codecov/codecov-action@v3
8282 with :
8383 directory : reports/
84+
85+
86+ publish :
87+ name : Publish package to PyPI
88+ runs-on : ubuntu-latest
89+ needs :
90+ - tests
91+ - e2e_tests
92+
93+ if : github.repository == 'django-commons/django-cookie-consent' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
94+
95+ environment :
96+ name : release
97+ url : https://pypi.org/project/django-cookie-consent/
98+ permissions :
99+ id-token : write
100+
101+ steps :
102+ - uses : actions/checkout@v4
103+ - uses : actions/setup-python@v5
104+ with :
105+ python-version : ' 3.12'
106+ - uses : actions/setup-node@v4
107+ with :
108+ node-version-file : ' js/.nvmrc'
109+ cache : npm
110+ registry-url : ' https://registry.npmjs.org'
111+
112+ # Required to ensure the build artifacts are in the packages.
113+ - uses : ./.github/actions/build-js
114+ with :
115+ npm-package : ' true'
116+ django-staticfiles : ' true'
117+
118+ - name : Build sdist and wheel
119+ run : |
120+ pip install build --upgrade
121+ python -m build
122+
123+ # TODO: enable verified publishing!
124+ - name : Publish a Python distribution to PyPI
125+ uses : pypa/gh-action-pypi-publish@release/v1
126+
127+ - name : Publish NPM package to Github
128+ run : |
129+ # Strip git ref prefix from version
130+ version=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
131+
132+ npm publish --new-version="$version" --provenance
133+ working-directory : js
134+ env :
135+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments