Release to NPM and PyPI #15
This file contains 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: Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
branches-ignore: | |
- '**' | |
workflow_dispatch: | |
env: | |
AWS_REGION: xxxxst-2 | |
CACHE_VERSION: xxxx | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
SNYK_TOKEN: xxxxa727 | |
TWINE_NON_INTERACTIVE: xxxx | |
TWINE_PASSWORD: xxxxi3Xc | |
TWINE_REPOSITORY_URL: xxxxacy/ | |
TWINE_USERNAME: xxxxen__ | |
jobs: | |
release_to_npm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
# - uses: actions/setup-node@v4 | |
# with: | |
# node-version: 16.13.2 | |
# registry-url: 'https://registry.npmjs.org' | |
# - run: npm ci | |
- name: Install Node dependencies | |
uses: "./.github/actions/install_node_dependencies" | |
- name: Build React application | |
run: |- | |
node -v | |
make build | |
# - name: Authenticate with registry | |
# run: | | |
# mkdir -p ~/repo/ | |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc | |
# - name: Authenticate with registry | |
# run: | | |
# # echo "registry=https://registry.npmjs.org/" >> .npmrc | |
# echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc | |
# Setup .npmrc file to publish to npm | |
- name: Publish to npm | |
run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# release_to_pypi: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/[email protected] | |
# - name: Set up Python 3.9 | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: 3.9 | |
# - name: Cache python packages for Linux | |
# uses: actions/cache@v4 | |
# with: | |
# path: ~/.cache/pip | |
# key: ubuntu-latest-python-3.9 | |
# - name: Setup Python environment | |
# uses: "./.github/actions/setup_python_env" | |
# - name: Install Node dependencies | |
# uses: "./.github/actions/install_node_dependencies" | |
# - name: Build React application | |
# run: |- | |
# node -v | |
# make build | |
# - name: Make Python package | |
# run: make package | |
# - name: Install twine | |
# run: python -m pip install -U twine | |
# - name: Publish to PyPI | |
# run: python -m twine upload package/dist/* |