-
-
Notifications
You must be signed in to change notification settings - Fork 209
52 lines (47 loc) · 1.69 KB
/
release-it.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
# #########################################################################
# Creates a new release using `workflow_dispatch` event trigger with `type`
# as input to describe the type of release to create
name: 'Release-it: Create a new release on demand'
on:
workflow_dispatch:
inputs:
type:
description: 'Type. Can be `patch` `minor` or `major`'
required: true
default: 'patch'
jobs:
release-it:
if: github.actor == 'robertsLando' || github.actor == 'chrisns' || github.actor == 'AlCalzone'
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: 'master'
fetch-depth: 0 # fetch all commits history to create the changelog
token: ${{ secrets.BOT_TOKEN }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Initialize NPM config
run: |
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Make the release
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.email "[email protected]"
git config user.name "Z-Wave JS Bot"
git config user.password "${{secrets.BOT_TOKEN}}"
echo "GIT_USER=${{github.actor}}:${{secrets.BOT_TOKEN}}" >> $GITHUB_ENV
npx release-it ${{github.event.inputs.type}} --ci --verbose