Skip to content

Commit b8cac20

Browse files
WIP
1 parent 70447c7 commit b8cac20

File tree

5 files changed

+97
-40
lines changed

5 files changed

+97
-40
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to NPM
1+
name: Publish Package to npmjs
22

33
on:
44
release:
@@ -11,17 +11,18 @@ on:
1111
default: patch
1212

1313
jobs:
14-
publish:
14+
build:
1515
runs-on: ubuntu-latest
16-
16+
permissions:
17+
contents: read
18+
id-token: write
1719
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Setup Node.js
22-
uses: actions/setup-node@v4
20+
- uses: actions/checkout@v4
21+
22+
# Setup .npmrc file to publish to npm
23+
- uses: actions/setup-node@v4
2324
with:
24-
node-version: '20'
25+
node-version: '20.x'
2526
registry-url: 'https://registry.npmjs.org'
2627

2728
- name: Install pnpm
@@ -38,24 +39,30 @@ jobs:
3839
- name: Build packages
3940
run: pnpm build
4041

41-
- name: Update package version (if triggered manually)
42-
if: github.event_name == 'workflow_dispatch'
42+
- name: Update package version
4343
run: |
4444
cd packages/eventstore
45-
if [ "${{ github.event.inputs.version }}" = "patch" ] || [ "${{ github.event.inputs.version }}" = "minor" ] || [ "${{ github.event.inputs.version }}" = "major" ]; then
46-
pnpm version ${{ github.event.inputs.version }} --no-git-tag-version
47-
else
48-
pnpm version ${{ github.event.inputs.version }} --no-git-tag-version
45+
if [ "${{ github.event_name }}" = "release" ]; then
46+
# Extract version from release tag (remove 'v' prefix if present)
47+
VERSION="${{ github.event.release.tag_name }}"
48+
VERSION="${VERSION#v}"
49+
npm version "$VERSION" --no-git-tag-version --allow-same-version
50+
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
51+
if [ "${{ github.event.inputs.version }}" = "patch" ] || [ "${{ github.event.inputs.version }}" = "minor" ] || [ "${{ github.event.inputs.version }}" = "major" ]; then
52+
npm version ${{ github.event.inputs.version }} --no-git-tag-version
53+
else
54+
npm version ${{ github.event.inputs.version }} --no-git-tag-version --allow-same-version
55+
fi
4956
fi
5057
5158
- name: Publish to NPM
5259
run: |
5360
cd packages/eventstore
54-
pnpm publish --access public --no-git-checks
61+
npm publish --provenance --access public
5562
env:
56-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
63+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5764

58-
- name: Create Git tag (if triggered manually)
65+
- name: Create Git tag and commit (if triggered manually)
5966
if: github.event_name == 'workflow_dispatch'
6067
run: |
6168
cd packages/eventstore

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"test": "pnpm -r test"
2020
},
2121
"devDependencies": {
22-
"@antfu/eslint-config": "5.2.1",
23-
"@types/node": "24.3.0",
24-
"eslint": "9.34.0",
25-
"vitest": "3.2.4",
26-
"vitest-mock-extended": "3.1.0"
22+
"@antfu/eslint-config": "catalog:",
23+
"@types/node": "catalog:",
24+
"eslint": "catalog:",
25+
"vitest": "catalog:",
26+
"vitest-mock-extended": "catalog:"
2727
}
2828
}

packages/eventstore/package.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
"description": "Event store package for Vorfall monorepo.",
66
"author": "",
77
"license": "MIT",
8+
"homepage": "https://github.com/lennartzellmer/vorfall#readme",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/lennartzellmer/vorfall.git",
12+
"directory": "packages/eventstore"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/lennartzellmer/vorfall/issues"
16+
},
817
"keywords": [
918
"eventstore",
1019
"event-sourcing",
@@ -18,14 +27,14 @@
1827
"lint": "eslint . --ext .ts,.tsx"
1928
},
2029
"dependencies": {
21-
"cloudevents": "^10.0.0",
22-
"mongodb": "^6.18.0"
30+
"cloudevents": "catalog:",
31+
"mongodb": "catalog:"
2332
},
2433
"devDependencies": {
25-
"mongodb-memory-server": "^10.2.0",
26-
"typescript": "^5.9.2",
27-
"vitest": "^3.2.4",
28-
"vitest-mock-extended": "^3.1.0"
34+
"mongodb-memory-server": "catalog:",
35+
"typescript": "catalog:",
36+
"vitest": "catalog:",
37+
"vitest-mock-extended": "catalog:"
2938
},
3039
"publishConfig": {
3140
"access": "public"

pnpm-lock.yaml

Lines changed: 41 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
packages:
22
- 'packages/*'
3+
4+
catalog:
5+
'@antfu/eslint-config': 5.2.1
6+
'@types/node': 24.3.0
7+
cloudevents: ^10.0.0
8+
eslint: 9.34.0
9+
mongodb: ^6.18.0
10+
mongodb-memory-server: ^10.2.0
11+
typescript: ^5.9.2
12+
vitest: 3.2.4
13+
vitest-mock-extended: 3.1.0

0 commit comments

Comments
 (0)