-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.75 KB
/
Copy pathrelease.yml
File metadata and controls
54 lines (52 loc) · 1.75 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
name: Publish release
on:
workflow_dispatch:
inputs:
version:
description: 'The version number to tag and release'
required: true
type: string
prerelease:
description: 'Release as pre-release'
required: false
type: boolean
default: false
jobs:
release-npm:
runs-on: ubuntu-latest
environment: main
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: Use supported Node.js Version
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Restore cached dependencies
uses: actions/cache@v5
with:
path: ~/.pnpm-store
key: node-modules-${{ hashFiles('package.json') }}
- name: Install dependencies
run: pnpm install
- name: Bump Version
run: node scripts/bump-version.js "${{ inputs.version }}" "${{ github.actor }}"
env:
GITHUB_ACTIONS: 'true'
- name: Push changes
run: git push origin HEAD:${{ github.ref }}
- name: Update npm
run: npm install -g npm@latest
- name: Publish to NPM
run: pnpm publish --access public --tag ${{ inputs.prerelease == true && 'next' || 'latest' }} --publish-branch ${{ github.ref_name }} --no-git-checks
- name: 'Create release notes'
run: |
pnpx @matteo.collina/release-notes -a ${{ secrets.GH_RELEASE_TOKEN }} -t v${{ inputs.version }} -r watt-admin -o platformatic ${{ github.event.inputs.prerelease == 'true' && '-p' || '' }} -c ${{ github.ref }}