Skip to content

Commit

Permalink
Add publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebouget committed Dec 1, 2023
1 parent bbbacf2 commit 659434d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to npm

on: workflow_dispatch

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Get latest tag
id: get_tag
run: echo "::set-output name=tag::$(git describe --tags --abbrev=0)"

- name: Update package.json version
run: |
echo "{\"version\": \"$(echo ${{ steps.get_tag.outputs.tag }} | sed 's/v//')\"}" > projects/khiops-webcomponent/src/package.json
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Install dependencies
run: npm install

- name: Build
run: npm run build:webcomponents

- name: Publish to npm
run: npm publish
working-directory: dist/khiops-webcomponent
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

0 comments on commit 659434d

Please sign in to comment.