Skip to content

Commit aa31a25

Browse files
committed
Revert "Split tag creation and publishing to NPM into separate flows (#28)"
This reverts commit dd68a75.
1 parent 4878c7b commit aa31a25

File tree

3 files changed

+41
-57
lines changed

3 files changed

+41
-57
lines changed

.github/workflows/create-tag.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
name: Publish to npm
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump:
7+
description: 'Version bump type'
8+
required: true
9+
default: 'minor'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
416
push:
5-
tags:
6-
- 'v*'
17+
branches:
18+
- main
19+
paths:
20+
- 'package.json'
21+
- 'index.js'
722

823
permissions:
924
id-token: write
@@ -16,19 +31,42 @@ jobs:
1631
steps:
1732
- name: Checkout code
1833
uses: actions/checkout@v5
34+
with:
35+
token: ${{ secrets.GH_PUSH_TOKEN }}
1936

2037
- name: Set up Node.js
2138
uses: actions/setup-node@v6
2239
with:
2340
node-version: '22'
2441
registry-url: 'https://registry.npmjs.org'
42+
cache: 'npm'
43+
44+
- name: Update npm
45+
run: npm install -g npm@latest
46+
47+
- name: Install dependencies
48+
run: npm install
49+
50+
- name: Verifying provenance attestations
51+
run: npm audit signatures
52+
53+
- name: Bump version and create tag
54+
id: bump-version
55+
run: |
56+
git config --global user.name "github-actions[bot]"
57+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
58+
TAG=$(npm version ${{ github.event.inputs.bump || 'minor' }} -m "Release %s [skip ci]")
59+
echo "Created tag: $TAG"
60+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
61+
git push origin main --follow-tags
2562
2663
- name: Publish to npm
2764
run: npm publish --provenance --access=public
2865

2966
- name: Create GitHub Release
3067
uses: softprops/action-gh-release@v2
3168
with:
69+
tag_name: ${{ steps.bump-version.outputs.tag }}
3270
generate_release_notes: true
3371
env:
3472
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-compatibility.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
uses: actions/setup-node@v6
4040
with:
4141
node-version: '22'
42+
cache: 'npm'
4243

4344
- name: Update npm
4445
run: npm install -g npm@latest

0 commit comments

Comments
 (0)