Skip to content

feat(javascript): introduce npm package #12

feat(javascript): introduce npm package

feat(javascript): introduce npm package #12

Workflow file for this run

name: Main
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
pip:
name: Publish to Pip
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Copy gradle properties
working-directory: python
run: |
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/gradle.properties > gradle.properties
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/README.md > README.md
- name: Install pypa/build
working-directory: python
run: python -m pip install build --user
- name: Build a binary wheel and a source tarball
working-directory: python
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
packages-dir: python/dist
npm:
name: Publish to Npm
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Copy Readme
working-directory: javascript
run: |
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/gradle.properties > gradle.properties
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/README.md > README.md
VERSION=$(cat gradle.properties | grep version= | sed "s/^version=//")
sed -i 's/"version": "0.0.0",/"version": "'$VERSION'",/' package.json
rm gradle.properties
- name: Install dependencies
working-directory: javascript
run: npm install
- name: Publish to npm
working-directory: javascript
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
end:
runs-on: ubuntu-latest
needs:
- pip
- npm
if: always()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
steps:
# Slack
- name: Slack notification
uses: Gamesight/slack-workflow-status@master
if: ${{ always() && env.SLACK_WEBHOOK_URL != 0 }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
name: GitHub Actions
icon_emoji: ':github-actions:'
channel: 'C02DQ1A7JLR'