-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (67 loc) · 1.98 KB
/
release.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Clibelt CI - Release
on:
push:
branches:
- master
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
persist-credentials: false
ref: master
- name: Install NodeJS
uses: actions/setup-node@master
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@master
env:
cache-name: clibelt-dependencies
with:
path: node_modules
key: clibelt-dependencies-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: npm ci
- name: Git Config
run: |
git config --local user.email "${{ secrets.GIT_USER_EMAIL }}"
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
git pull
- name: Unit Tests
run: npm test
env:
CI: true
- name: Run Prettier
id: run-prettier
run: |
npm run prettify
echo "::set-output name=changed-files::$(git status -s -uno | wc -l)"
- name: Commit Changes
if: steps.run-prettier.outputs.changed-files > 0
run: |
git add .
git commit -m "Release Ops" -a
- name: Increase Version
run: npm version patch
- name: Push Updates
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Package
run: npm run upload
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Send Notification
uses: Co-qn/google-chat-notification@master
with:
name: Clibelt - Release
url: ${{ secrets.GOOGLE_CHAT }}
status: ${{ job.status }}
if: always()