Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,55 @@ jobs:
uses: codecov/codecov-action@v3
with:
directory: reports/


publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs:
- tests
- e2e_tests

if: github.repository == 'django-commons/django-cookie-consent' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

environment:
name: release
url: https://pypi.org/project/django-cookie-consent/
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version-file: 'js/.nvmrc'
cache: npm
registry-url: 'https://registry.npmjs.org'

# Required to ensure the build artifacts are in the packages.
- uses: ./.github/actions/build-js
with:
npm-package: 'true'
django-staticfiles: 'true'

- name: Build sdist and wheel
run: |
pip install build --upgrade
python -m build

# TODO: enable verified publishing!
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Publish NPM package to Github
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Publish NPM package to Github
- name: Publish NPM package to NPM

run: |
# Strip git ref prefix from version
version=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')

npm publish --new-version="$version" --provenance
working-directory: js
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
56 changes: 0 additions & 56 deletions .github/workflows/release.yml

This file was deleted.