@nerd-bible/valio 0.0.4 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,21 @@
1
1
  name: Publish Package
2
2
  on:
3
3
  push:
4
- tags:
5
- - v*
4
+ branches:
5
+ - master
6
6
  permissions:
7
- id-token: write # Required for npm OIDC
8
- contents: read
7
+ id-token: write # npm OIDC
8
+ contents: write # push tags
9
9
  jobs:
10
10
  publish:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
14
16
  - uses: oven-sh/setup-bun@v2
15
- - run: bun install
17
+ - run: bun ci
16
18
  - run: bun run build
17
19
  - run: bun test
18
20
  - run: bun run fmt
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: '20'
22
- registry-url: 'https://registry.npmjs.org'
23
- # Ensure npm 11.5.1 or later is installed
24
- - name: Update npm
25
- run: npm install -g npm@latest
26
- - run: npm publish
21
+ - run: ./publish.sh
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "@nerd-bible/valio",
3
- "version": "0.0.4",
4
- "type": "module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "devDependencies": {
8
- "@biomejs/biome": "^2.3.1",
9
- "@types/bun": "latest"
10
- },
11
- "scripts": {
12
- "build": "tsc",
13
- "fmt": "biome check",
14
- "fmt-fix": "biome check --write --unsafe"
15
- },
16
- "peerDependencies": {
17
- "typescript": "^5.9.3"
18
- },
19
- "repository": {
20
- "url": "git+https://github.com/nerd-bible/valio"
21
- }
2
+ "name": "@nerd-bible/valio",
3
+ "type": "module",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "devDependencies": {
7
+ "@biomejs/biome": "^2.3.1",
8
+ "@types/bun": "latest"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "fmt": "biome check",
13
+ "fmt-fix": "biome check --write --unsafe"
14
+ },
15
+ "peerDependencies": {
16
+ "typescript": "^5.9.3"
17
+ },
18
+ "version": "0.0.8",
19
+ "repository": {
20
+ "url": "git+https://github.com/nerd-bible/valio"
21
+ }
22
22
  }
package/publish.sh ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+
4
+ TAG_CMD="git describe --tags --abbrev=0 --match=v[0-9]*.[0-9]*.[0-9]*"
5
+
6
+ git fetch --tags
7
+ VERSION=$($TAG_CMD --exact-match 2>/dev/null || true)
8
+ if [[ -z $VERSION ]]; then
9
+ VERSION=$($TAG_CMD 2>/dev/null || echo 'v0.0.0')
10
+ echo "No manual tag, bumping $VERSION"
11
+ VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF += 1 ; print}')
12
+ git tag $VERSION
13
+ git push --tags origin master
14
+ fi
15
+ echo "Publishing $VERSION"
16
+ cat <<< $(jq ".version = \"${VERSION:1}\" |\
17
+ .repository.url = \"git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY\"" package.json) > package.json
18
+
19
+ bunx npm@latest publish