@nerd-bible/valio 0.0.7 → 0.0.9

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.
@@ -3,17 +3,23 @@ on:
3
3
  push:
4
4
  tags:
5
5
  - v*
6
+ branches:
7
+ - master
6
8
  permissions:
7
- id-token: write # Required for npm OIDC
8
- contents: read
9
+ id-token: write # npm OIDC
10
+ contents: write # push tags
9
11
  jobs:
10
12
  publish:
11
13
  runs-on: ubuntu-latest
12
14
  steps:
15
+ - name: Print GitHub event action
16
+ run: echo "${{ github.event_name }}"
13
17
  - uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0 # whole history needed for potential tag bump
14
20
  - uses: oven-sh/setup-bun@v2
15
21
  - run: bun ci
16
22
  - run: bun run build
17
23
  - run: bun test
18
24
  - run: bun run fmt
19
- - run: bunx npm@latest publish
25
+ - run: ./publish.sh
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "@nerd-bible/valio",
3
- "version": "0.0.7",
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.9",
19
+ "repository": {
20
+ "url": "git+https://github.com/nerd-bible/valio"
21
+ }
22
22
  }
package/publish.sh ADDED
@@ -0,0 +1,23 @@
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
+ # is the latest commit missing a version tag?
9
+ if [[ -z $VERSION ]]; then
10
+ VERSION=$($TAG_CMD 2>/dev/null || echo 'v0.0.0')
11
+ echo "No manual tag, bumping $VERSION"
12
+ VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF += 1 ; print}')
13
+ git tag $VERSION
14
+ git push --tags origin master
15
+ fi
16
+ echo "Publishing $VERSION"
17
+ JIT_JSON=$(cat package.json | jq "
18
+ .version = \"${VERSION:1}\" |
19
+ .repository.url = \"git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY\"
20
+ ")
21
+ echo -E "$JIT_JSON" > package.json
22
+
23
+ bunx npm@latest publish