-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (62 loc) · 2.07 KB
/
release.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
name: Release
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Unset header
# https://github.com/intuit/auto/issues/1030
run: git config --local --unset http.https://github.com/.extraheader
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: npm-deps-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-deps-${{ hashFiles('package-lock.json') }}
- name: Setup packages
run: |
npm ci
- name: Lint
run: npm run lint
- name: Release Info
run: npm whoami && npx auto info || echo 'auto info returned 1'
- name: Create Release
run: npm run release
- name: Update package-lock's
if: github.event_name != 'pull_request'
run: |
npm i --package-lock-only
- name: Extract branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Commit & Push package-lock's
if: github.event_name != 'pull_request'
uses: actions-js/push@master
with:
github_token: ${{ secrets.GH_TOKEN }}
message: "chore: update package-locks [skip ci]"
branch: ${{ steps.extract_branch.outputs.branch }}
author_name: Salute Frontend Team
author_email: [email protected]