generated from klientjs/open-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (82 loc) · 2.25 KB
/
release.yml
File metadata and controls
91 lines (82 loc) · 2.25 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Create a new tag and Github release
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Release type
required: true
options:
- patch
- minor
- major
preRelease:
type: choice
description: Pre release
required: false
options:
- ''
- alpha
- beta
- rc
node:
type: choice
description: Node version
required: false
options:
- ''
- 20.x
- 18.x
- 16.x
- 14.x
- 12.x
audit:
type: boolean
description: Npm audit
default: true
dry:
type: boolean
description: Dry mode
default: false
jobs:
release:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT || github.token }}
RELEASE_TYPE: ${{ github.event.inputs.type }}
PRE_RELEASE: ${{ github.event.inputs.preRelease }}
DRY_ARG: ${{ github.event.inputs.dry == 'true' && '--dry-run' || '' }}
AUDIT: ${{ github.event.inputs.audit }}
NODE_VERSION: ${{ github.event.inputs.node || vars.NODE_VERSION || '16.x' }}
CACHE: ${{ vars.CACHE_DEPENDENCIES != '0' && 'npm' || '' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: ${{ env.CACHE }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Check vulnerabilities
if: env.AUDIT == 'true'
run: npm audit
- name: Code analysis
run: |
npm run prettier
npm run lint
# Launched during release script
# npm run test
- name: Configure GIT
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@github.com"
- name: Release it
run: |
if [ "$PRE_RELEASE" != "" ]; then
PRE_RELEASE_ARG=--preRelease=$PRE_RELEASE;
fi;
npm run release -- --ci --verbose $DRY_ARG $PRE_RELEASE_ARG --increment=$RELEASE_TYPE