-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (47 loc) · 1.6 KB
/
publish.yml
File metadata and controls
57 lines (47 loc) · 1.6 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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Publish on NPM
on:
workflow_dispatch:
inputs:
version-increment:
type: choice
description: 'Version Increment'
required: true
options:
- 'patch'
- 'minor'
- 'major'
default: 'patch'
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
publish-on-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup environment
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Versionate
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
npm version ${{ github.event.inputs.version-increment }}
- name: Build
run: npm ci
- name: Publish to NPM
# This command uses the GitHub OIDC token automatically
run: npm publish
- name: Create PR
uses: peter-evans/create-pull-request@v4.2.4
with:
commit-message: Updated repository to ${{ steps.publish.outputs.version }}
title: Bump version to ${{ steps.publish.outputs.version }}
body: New release build
branch: release/${{ steps.publish.outputs.version }}
base: master