feat(javascript): add logger function #23
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 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: 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 | |
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: 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: 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 }} | |
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' |