Publish to PyPI and NPM #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI and NPM | |
on: | |
release: | |
types: [published] | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
publish: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.12] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
mamba-version: "*" | |
channels: conda-forge | |
- name: Mamba install dependencies | |
run: mamba install python=${{ matrix.python-version }} pip nodejs yarn jupyter-packaging | |
- name: Mamba install JupyterLab 3 | |
run: mamba install jupyterlab=3.5 ipywidgets=7.6 | |
- name: Install tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine jupyter-packaging | |
- name: Build the package | |
run: | | |
node --version | |
npm --version | |
yarn --version | |
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/ | |
pip install . | |
python setup.py sdist bdist_wheel | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
verbose: true | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 22 | |
- name: Publish to NPM | |
run: | | |
cd js | |
npm config set @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/ | |
npm install --legacy-peer-deps | |
npm run build | |
npm config delete @here:registry https://repo.platform.here.com/artifactory/api/npm/here-node/ | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
npm publish --access=public | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |