-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.82 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (56 loc) · 1.82 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
name: Release
on:
workflow_dispatch:
inputs:
dry-run:
description: Dry run
required: false
default: false
type: boolean
tag:
description: The tag to use during publish, values are latest, next
required: false
default: latest
type: choice
options:
- latest
- next
permissions:
contents: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish-npm:
runs-on: ubuntu-latest
environment: npm
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Run Unit Tests
run: |
npm ci
npm run test
- name: Run Build
run: npm run build
- name: Publish to npm
run: npm publish --tag ${{ github.event.inputs.tag || 'latest' }} --access public --provenance ${{ github.event.inputs.dry-run == 'true' && '--dry-run' || '' }}
- name: Get Version
id: get-version
run: |
echo "version=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
- name: Parse CHANGELOG.md
id: parse-changelog
uses: schwma/parse-changelog-action@69a9f9ab4cf2f2e736108ab41396fc3c55f65e40 # v1.0.0
with:
version: '${{ steps.get-version.outputs.version }}'
title-regex: '^##\s+\[\d.*$'
- name: Create a GitHub release
if: ${{ github.event.inputs.dry-run != 'true' }}
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
with:
tag: 'v${{ steps.get-version.outputs.version }}'