@plutocms/utils 0.0.1-alpha.7 → 0.1.0
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.
- package/.github/dependabot.yml +6 -7
- package/.github/workflows/ci.yml +34 -0
- package/.github/workflows/release.yml +26 -80
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/release-please-config.json +9 -0
- package/.github/workflows/publish.yml +0 -59
package/.github/dependabot.yml
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
-
|
|
6
1
|
version: 2
|
|
7
2
|
updates:
|
|
8
|
-
- package-ecosystem: bun
|
|
9
|
-
directory: /
|
|
3
|
+
- package-ecosystem: bun
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
- package-ecosystem: github-actions
|
|
8
|
+
directory: /
|
|
10
9
|
schedule:
|
|
11
10
|
interval: weekly
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
ci:
|
|
13
|
+
name: Lint, typecheck & build
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Bun
|
|
20
|
+
uses: oven-sh/setup-bun@v2
|
|
21
|
+
with:
|
|
22
|
+
bun-version: latest
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: bun install --frozen-lockfile
|
|
26
|
+
|
|
27
|
+
- name: Lint
|
|
28
|
+
run: bun run lint
|
|
29
|
+
|
|
30
|
+
- name: Typecheck
|
|
31
|
+
run: bun run typecheck
|
|
32
|
+
|
|
33
|
+
- name: Build
|
|
34
|
+
run: bun run build
|
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
name: Release
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
bump:
|
|
7
|
-
description: Version bump type (auto-detected from conventional commits if not set)
|
|
8
|
-
required: false
|
|
9
|
-
default: ''
|
|
10
|
-
type: choice
|
|
11
|
-
options:
|
|
12
|
-
- ''
|
|
13
|
-
- patch
|
|
14
|
-
- minor
|
|
15
|
-
- major
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
16
6
|
|
|
17
|
-
# Prevent concurrent releases
|
|
18
7
|
concurrency:
|
|
19
8
|
group: release
|
|
20
9
|
cancel-in-progress: false
|
|
21
10
|
|
|
22
11
|
jobs:
|
|
23
|
-
release:
|
|
24
|
-
name:
|
|
12
|
+
release-please:
|
|
13
|
+
name: Release Please
|
|
25
14
|
runs-on: ubuntu-latest
|
|
26
15
|
permissions:
|
|
27
16
|
contents: write
|
|
28
17
|
pull-requests: write
|
|
18
|
+
outputs:
|
|
19
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
20
|
+
steps:
|
|
21
|
+
- name: Run release-please
|
|
22
|
+
id: release
|
|
23
|
+
uses: googleapis/release-please-action@v4
|
|
24
|
+
with:
|
|
25
|
+
token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
|
|
29
26
|
|
|
27
|
+
publish:
|
|
28
|
+
name: Publish to npm
|
|
29
|
+
needs: release-please
|
|
30
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
permissions:
|
|
33
|
+
id-token: write # npm provenance via OIDC trusted publishing
|
|
34
|
+
contents: read
|
|
30
35
|
steps:
|
|
31
36
|
- name: Checkout
|
|
32
37
|
uses: actions/checkout@v4
|
|
33
|
-
with:
|
|
34
|
-
fetch-depth: 0 # full history required by changelogen to read all commits
|
|
35
38
|
|
|
36
39
|
- name: Setup Bun
|
|
37
|
-
uses: oven-sh/setup-bun@
|
|
40
|
+
uses: oven-sh/setup-bun@v2
|
|
38
41
|
with:
|
|
39
42
|
bun-version: latest
|
|
40
43
|
|
|
@@ -42,69 +45,12 @@ jobs:
|
|
|
42
45
|
uses: actions/setup-node@v4
|
|
43
46
|
with:
|
|
44
47
|
node-version: 24
|
|
45
|
-
|
|
46
|
-
- name: Configure git
|
|
47
|
-
run: |
|
|
48
|
-
git config user.name "github-actions[bot]"
|
|
49
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
48
|
+
registry-url: https://registry.npmjs.org/
|
|
50
49
|
|
|
51
50
|
- name: Install dependencies
|
|
52
51
|
run: bun install --frozen-lockfile
|
|
53
52
|
|
|
54
|
-
- name:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
run: bun test || true
|
|
59
|
-
|
|
60
|
-
# Create a release branch before changelogen, run changelogen and commit on the branch, push, then open PR
|
|
61
|
-
- name: Create release branch
|
|
62
|
-
run: |
|
|
63
|
-
VERSION_BEFORE=$(node -p "require('./package.json').version")
|
|
64
|
-
BRANCH="release/v$VERSION_BEFORE"
|
|
65
|
-
git checkout -b "$BRANCH"
|
|
66
|
-
|
|
67
|
-
# Run changelogen and only commit if there are changes
|
|
68
|
-
- name: Bump version and generate changelog (on release branch)
|
|
69
|
-
id: changelogen
|
|
70
|
-
run: |
|
|
71
|
-
BUMP="${{ inputs.bump }}"
|
|
72
|
-
if [ -n "$BUMP" ]; then
|
|
73
|
-
npx changelogen@latest --$BUMP
|
|
74
|
-
else
|
|
75
|
-
npx changelogen@latest --bump
|
|
76
|
-
fi
|
|
77
|
-
git add package.json CHANGELOG.md || true
|
|
78
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
79
|
-
# Only commit if there are changes
|
|
80
|
-
if ! git diff --cached --quiet; then
|
|
81
|
-
git commit -m "chore(release): v$VERSION"
|
|
82
|
-
echo "has_changes=true" >> $GITHUB_ENV
|
|
83
|
-
else
|
|
84
|
-
echo "No changes to commit. Skipping PR creation."
|
|
85
|
-
echo "has_changes=false" >> $GITHUB_ENV
|
|
86
|
-
fi
|
|
87
|
-
env:
|
|
88
|
-
GH_TOKEN: ${{ github.token }}
|
|
89
|
-
|
|
90
|
-
- name: Push release branch
|
|
91
|
-
if: env.has_changes == 'true'
|
|
92
|
-
run: |
|
|
93
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
94
|
-
BRANCH="release/v$VERSION"
|
|
95
|
-
git push origin "$BRANCH"
|
|
96
|
-
env:
|
|
97
|
-
GH_TOKEN: ${{ github.token }}
|
|
98
|
-
|
|
99
|
-
- name: Create release PR
|
|
100
|
-
if: env.has_changes == 'true'
|
|
101
|
-
run: |
|
|
102
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
103
|
-
BRANCH="release/v$VERSION"
|
|
104
|
-
gh pr create \
|
|
105
|
-
--title "v$VERSION" \
|
|
106
|
-
--body "Release v$VERSION" \
|
|
107
|
-
--base main \
|
|
108
|
-
--head "$BRANCH"
|
|
109
|
-
env:
|
|
110
|
-
GH_TOKEN: ${{ github.token }}
|
|
53
|
+
- name: Publish to npm
|
|
54
|
+
# No token needed — OIDC trusted publishing handles auth automatically.
|
|
55
|
+
# Provenance is also generated automatically; no --provenance flag required.
|
|
56
|
+
run: npm publish --access public
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0](https://github.com/plutocms/utils/compare/v0.0.1-alpha.7...v0.1.0) (2026-07-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **ci:** migrate to release-please for automated releases ([272688f](https://github.com/plutocms/utils/commit/272688fb582ac66189fffbe7bd0df5828beeafc1))
|
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [closed]
|
|
6
|
-
branches: [main]
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
publish:
|
|
10
|
-
name: Publish to npm
|
|
11
|
-
# Only run when a release PR (title = vX.X.X) is merged
|
|
12
|
-
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'v')
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
permissions:
|
|
15
|
-
contents: write # push tags & create GitHub releases
|
|
16
|
-
id-token: write # npm provenance attestation
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- name: Checkout
|
|
20
|
-
uses: actions/checkout@v4
|
|
21
|
-
|
|
22
|
-
- name: Setup Bun
|
|
23
|
-
uses: oven-sh/setup-bun@v1
|
|
24
|
-
with:
|
|
25
|
-
bun-version: latest
|
|
26
|
-
|
|
27
|
-
- name: Setup Node.js
|
|
28
|
-
uses: actions/setup-node@v4
|
|
29
|
-
with:
|
|
30
|
-
node-version: 24
|
|
31
|
-
registry-url: https://registry.npmjs.org/
|
|
32
|
-
|
|
33
|
-
- name: Configure git
|
|
34
|
-
run: |
|
|
35
|
-
git config user.name "github-actions[bot]"
|
|
36
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
37
|
-
|
|
38
|
-
- name: Install dependencies
|
|
39
|
-
run: bun install --frozen-lockfile
|
|
40
|
-
|
|
41
|
-
- name: Publish to npm
|
|
42
|
-
run: |
|
|
43
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
44
|
-
if [[ "$VERSION" == *-* ]]; then
|
|
45
|
-
TAG=$(echo "$VERSION" | sed -E 's/^[0-9]+\.[0-9]+\.[0-9]+-([a-zA-Z]+).*/\1/')
|
|
46
|
-
else
|
|
47
|
-
TAG=latest
|
|
48
|
-
fi
|
|
49
|
-
npm publish --provenance --access public --tag "$TAG"
|
|
50
|
-
|
|
51
|
-
# Only tag and create the GitHub release after a successful publish
|
|
52
|
-
- name: Create git tag and GitHub release
|
|
53
|
-
run: |
|
|
54
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
55
|
-
git tag "v$VERSION"
|
|
56
|
-
git push origin "v$VERSION"
|
|
57
|
-
gh release create "v$VERSION" --generate-notes --title "v$VERSION"
|
|
58
|
-
env:
|
|
59
|
-
GH_TOKEN: ${{ github.token }}
|