-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (54 loc) · 1.69 KB
/
ci.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
name: Release @novemberfiveco/skidder-react
concurrency:
group: publish-${{ github.github.base_ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
type:
type: choice
description: 'Choose the release type'
options:
- patch
- minor
- major
required: true
default: patch
dry:
type: boolean
description: Dry run release
default: false
jobs:
publish:
if: github.repository == 'novemberfiveco/skidder-react' && github.ref == 'refs/heads/master'
name: 'Publish'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
token: ${{ secrets.GH_PUSH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: '18.15.0'
registry-url: https://registry.npmjs.org/
cache: 'npm'
- name: Git Config
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: NPM Credentials
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Release
run: npm run release -- --ci -V --increment $TYPE_ARG $DRY_ARG
env:
GITHUB_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
TYPE_ARG: ${{ inputs.type }}
DRY_ARG: ${{ inputs.dry == true && '--dry-run' || '' }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}