-
Notifications
You must be signed in to change notification settings - Fork 36
65 lines (51 loc) · 1.97 KB
/
publish-on-npm.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
58
59
60
61
62
63
64
65
name: "Bump version and publish on npm"
on:
workflow_dispatch:
branches:
- "master"
jobs:
build-test-deploy:
name: Build, test, bump version and deploy the library on npm
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@master
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- uses: actions/checkout@master
- name: "Install dependency"
run: npm ci
# Workflow using with https://github.com/maks-stupak/gh-action-bump-version
# Based on the commit messages, increment the version from the latest release.
# - If the string "major" is found anywhere in any of the commit messages or descriptions the major version will be incremented.
# - If includes "minor" then the minor version will be increased.
# - If includes "patch" then the patch version will be increased.
- name: "Automated version bump for library"
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: ""
env:
PACKAGEJSON_DIR: "./projects/ngx-image-compress"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Automated version bump for demo app"
uses: "phips28/gh-action-bump-version@master"
with:
tag-prefix: "demo-"
env:
PACKAGEJSON_DIR: "./"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build'
run: npm run build
- name: 'Test the library'
run: npm run test:lib
- name: 'Test the demo app'
run: npm run test:app
- name: "Ship the README.md with the library build"
run: cp ./README.md ./dist/ngx-image-compress/README.md
- name: "Ship the LICENSE"
run: cp ./LICENSE ./dist/ngx-image-compress/LICENSE
- name: "Publish the library on npm"
working-directory: ./dist/ngx-image-compress
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish