fix(#9): Module error when using Javascript #30
Workflow file for this run
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: Main | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
pip: | |
name: Publish to Pip | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Copy Readme | |
working-directory: python | |
run: | | |
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: Install deps | |
working-directory: python | |
run: pip install .[test] | |
- name: Run unit tests | |
working-directory: python | |
run: pytest | |
- name: Build a binary wheel and a source tarball | |
if: startsWith(github.ref, 'refs/tags/v') | |
working-directory: python | |
env: | |
VERSION: ${{ github.ref_name }} | |
run: python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags/v') | |
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 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Set version | |
id: set_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Copy Readme | |
working-directory: javascript | |
run: | | |
curl -s https://raw.githubusercontent.com/kestra-io/kestra/master/README.md > README.md | |
sed -i 's/"version": "0.0.0",/"version": "'$VERSION'",/' package.json | |
- name: Install dependencies | |
working-directory: javascript | |
run: npm install | |
- name: Run unit tests | |
working-directory: javascript | |
run: npm run test | |
- name: Publish to npm | |
working-directory: javascript | |
run: npm publish --access public | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
release: | |
name: Create GitHub Release | |
runs-on: ubuntu-latest | |
needs: | |
- pip | |
- npm | |
steps: | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
end: | |
runs-on: ubuntu-latest | |
needs: | |
- release | |
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' |