-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.15 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Publish to NPM
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fetch complete history
run: git fetch --prune --unshallow
- name: 'Get Previous tag'
id: previoustag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
with:
prefix: v
- name: Update package.json version
run: |
NEW_VERSION="${PREVTAG:1}" # Remove the 'v' from the tag
sed -i "s/\"version\": \".*\"/\"version\": \"$NEW_VERSION\"/" projects/khiops-webcomponent/src/package.json
cat projects/khiops-webcomponent/src/package.json
env:
PREVTAG: ${{ steps.previoustag.outputs.tag }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build:webcomponents
- name: Publish to npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_AUTH_TOKEN }}
package: dist/khiops-webcomponent