Skip to content

Commit

Permalink
👷 Publish npm package with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed May 2, 2024
1 parent 155e41e commit 1f78cf3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/actions/build-js/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ runs:
node-version-file: 'js/.nvmrc'
cache: npm
cache-dependency-path: js/package-lock.json
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
run: npm ci
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ name: Release

on:
push:
branches:
- feature/isolate-js
tags:
- '*'

jobs:
build:
name: Publish package to Jazzband private PyPI
name: Publish packages
runs-on: ubuntu-latest
if: github.repository == 'jazzband/django-cookie-consent'

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -37,10 +43,17 @@ jobs:
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-cookie-consent/upload
# - name: Upload packages to Jazzband private PyPI
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: jazzband
# password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
# repository_url: https://jazzband.co/projects/django-cookie-consent/upload

- name: Publish NPM package to Github
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: npm pack
working-directory: js
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1f78cf3

Please sign in to comment.