Skip to content

Commit d2f11c5

Browse files
authored
Merge pull request #2 from Tracktor/fix/change-to-gh
fix: add version configuration and release workflow
2 parents 6a1a5d5 + 3168252 commit d2f11c5

7 files changed

Lines changed: 1155 additions & 3179 deletions

File tree

.circleci/config.yml

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

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: latest
26+
27+
- name: Install dependencies
28+
run: bun install
29+
30+
- name: Run lint & tests
31+
run: bun run test
32+
33+
- name: Bump version & generate changelog
34+
run: npx standard-version --release-as auto
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Push changes & tags
39+
run: |
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
git push --follow-tags origin main
43+
44+
- name: Build project
45+
run: bun run build
46+
47+
- name: Check if version already exists on npm
48+
run: |
49+
PKG_NAME=$(jq -r .name package.json)
50+
VERSION=$(jq -r .version package.json)
51+
if npm view $PKG_NAME versions --json | grep -q "\"$VERSION\""; then
52+
echo "⚠️ Version $VERSION already exists on npm. Skipping publish."
53+
exit 0
54+
fi
55+
56+
- name: Get version from package.json
57+
id: get_version
58+
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
59+
60+
- name: Create GitHub Release
61+
uses: softprops/action-gh-release@v2
62+
with:
63+
tag_name: ${{ steps.get_version.outputs.version }}
64+
body_path: CHANGELOG.md
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Publish to npm
69+
run: bun publish --access public
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.versionrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"skip": {
3+
"tag": false
4+
},
5+
"types": [
6+
{ "type": "feat", "section": "✨ Features" },
7+
{ "type": "fix", "section": "🐛 Fixes" },
8+
{ "type": "chore", "hidden": true },
9+
{ "type": "docs", "hidden": true },
10+
{ "type": "style", "hidden": true },
11+
{ "type": "refactor", "hidden": true },
12+
{ "type": "test", "hidden": true }
13+
]
14+
}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ or
2323
npm install @tracktor/react-google-tag-manager
2424
```
2525

26+
or
27+
28+
```console
29+
bun add @tracktor/react-google-tag-manager
30+
```
31+
2632
## Usage
2733

2834
```typescript jsx

bun.lock

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"lint": "biome check --diagnostic-level=error . && tsc --noEmit --incremental",
3333
"lint:fix": "biome check . --write",
3434
"preview": "vite preview",
35-
"test": "yarn lint && vitest",
36-
"prepare": "yarn run build && husky install"
35+
"test": "bun run lint && vitest",
36+
"prepare": "bun run build && husky install"
3737
},
3838
"dependencies": {
3939
"@tracktor/react-utils": "^1.24.0"

0 commit comments

Comments
 (0)