-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (81 loc) · 2.31 KB
/
releases.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Publish package to registry
on:
workflow_dispatch:
inputs:
version:
description: Version to publish
default: 1.0.0
required: true
release:
types:
- released
jobs:
publish:
runs-on: ubuntu-latest
steps:
#
# Checkout repository
#
- name: Checkout
uses: actions/checkout@v4
#
# Setup Node.js
#
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
#
# Setup PNPM package manager
#
- name: Setup package manager
uses: pnpm/action-setup@v2
with:
version: 8
#
# Install all dependencies
#
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
# Build package and generate javascript files
#
- name: Build package
run: pnpm build
#
# Configure git user email
#
- if: github.event_name == 'release'
name: Configure git user email
run: git config --global user.email "${{ github.event.release.author.email }}"
- if: github.event_name == 'workflow_dispatch'
name: Configure git user email
run: git config --global user.email "${{ github.actor }}@users.noreply.github.com"
#
# Configure git user name
#
- if: github.event_name == 'release'
name: Configure git user name
run: git config --global user.name "${{ github.event.release.author.login }}"
- if: github.event_name == 'workflow_dispatch'
name: Configure git user name
run: git config --global user.name "${{ github.actor }}"
#
# Change package version
#
- if: github.event_name == 'release'
name: Change package version
run: pnpm version ${{ github.event.release.tag_name }}
- if: github.event_name == 'workflow_dispatch'
name: Change package version
run: pnpm version ${{ github.event.inputs.version }}
#
# Publish package to destination registry
#
- name: Publish package to registry
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}