-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-npm-package-pipeline.yml
More file actions
70 lines (57 loc) · 1.86 KB
/
Copy pathpublish-npm-package-pipeline.yml
File metadata and controls
70 lines (57 loc) · 1.86 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
name: workflow - publish npm comanda sdk package
on:
push:
branches:
- master
- development
paths:
- 'Artifacts/Comanda.Internal.Sdk/**'
pull_request:
branches:
- master
- development
paths:
- 'Artifacts/Comanda.Internal.Sdk/**'
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Artifacts/Comanda.Internal.Sdk
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: setup node.js environment
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: install dependencies
run: npm install
- name: build
run: npm run build
- name: run tests
run: npm test
- name: prepare git for version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "ci: prepare repository for version bump" || echo "no changes to commit"
- name: bump version
run: |
if [ "${{ github.ref_name }}" = "master" ]; then
npm version minor -m "ci: bump minor version to %s"
elif [ "${{ github.ref_name }}" = "development" ]; then
npm version patch -m "ci: bump patch version to %s"
fi
- name: publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: prepare git for version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "ci: prepare repository for version bump" || echo "no changes to commit"