-
-
Notifications
You must be signed in to change notification settings - Fork 21
80 lines (63 loc) · 1.88 KB
/
on_push.yaml
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
71
72
73
74
75
76
77
78
79
80
name: New Release
on:
push:
branches: [main]
paths-ignore:
- "**/*.md"
- "LISCENSE"
- ".gitignore"
- ".eslintrs.js"
- ".eslintignore"
- "**/*.cy.ts"
- "**/*.test.ts"
- "./jest.config.js"
- "./cypress.config.ts"
permissions:
contents: write
discussions: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set git configuration
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Cache node modules
uses: actions/cache@v3
with:
key: node-modules-${{ hashFiles('**/package-lock.json') }}
path: |
~/.npm
./node_modules
- name: Get package version
run: |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
echo "Package version is $PACKAGE_VERSION"
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build:production
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
name: "SimpleMaskMoney - v${{ env.PACKAGE_VERSION }}"
tag_name: "v${{ env.PACKAGE_VERSION }}"
files: |
lib/*
package.json
package-lock.json
- name: Create Npm Release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish --access public --userconfig ./.npmrc