-
-
Notifications
You must be signed in to change notification settings - Fork 184
57 lines (53 loc) · 1.66 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
46
47
48
49
50
51
52
53
54
55
56
57
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: publish driver
# FIXME
# npm token kep raising as invalid while it had proper one.
on:
workflow_dispatch:
# push:
# branches: [ main ]
# # paths:
# # - 'driver/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install
working-directory: driver
- run: npm test
working-directory: driver
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm install --no-package-lock
working-directory: driver
- name: update npm-shrinkwrap.json
working-directory: driver
run: |
rm -rf package-lock.json node_modules
npm prune --omit=dev --omit=peer --no-package-lock
npm shrinkwrap --omit=dev --omit=peer
git diff
- run: npm install --only=dev --no-package-lock
name: Install dev dependencies for the release
working-directory: driver
- run: npx semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# to make the push failure
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Release
working-directory: driver