Skip to content

Commit dc77648

Browse files
committed
chore: update for standalone repo (remove monorepo config, add CI/CD)
1 parent f7744e6 commit dc77648

5 files changed

Lines changed: 159 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
push:
7+
branches: [develop]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm install
24+
25+
- name: Build
26+
run: npm run build
27+
28+
- name: Type check
29+
run: npm run typecheck
30+
31+
- name: Verify build output
32+
run: |
33+
if [[ ! -d "dist" ]]; then
34+
echo "Build failed: dist directory not found"
35+
exit 1
36+
fi
37+
echo "Build verification passed"
38+

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
persist-credentials: false
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: https://registry.npmjs.org/
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Verify build output
36+
run: |
37+
if [[ ! -d "dist" ]]; then
38+
echo "Build failed: dist directory not found"
39+
exit 1
40+
fi
41+
echo "Build verification passed"
42+
43+
- name: Release
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
run: npx semantic-release
49+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Update pp-dev Dependency
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 */6 * * *' # Every 6 hours
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Check for pp-dev updates
21+
id: check
22+
run: |
23+
CURRENT=$(node -p "require('./package.json').devDependencies['@metricinsights/pp-dev'].replace('^', '')")
24+
LATEST=$(npm view @metricinsights/pp-dev version)
25+
26+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
27+
echo "latest=$LATEST" >> $GITHUB_OUTPUT
28+
29+
if [ "$CURRENT" != "$LATEST" ]; then
30+
echo "needs_update=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "needs_update=false" >> $GITHUB_OUTPUT
33+
fi
34+
35+
- name: Update dependency
36+
if: steps.check.outputs.needs_update == 'true'
37+
run: |
38+
VERSION=${{ steps.check.outputs.latest }}
39+
40+
# Update package.json
41+
npm pkg set devDependencies.@metricinsights/pp-dev="^$VERSION"
42+
43+
# Update all template package.json files
44+
find template-* -name "package.json" -exec sed -i \
45+
"s/\"@metricinsights\/pp-dev\": \"[^\"]*\"/\"@metricinsights\/pp-dev\": \"^$VERSION\"/g" {} \;
46+
47+
- name: Create Pull Request
48+
if: steps.check.outputs.needs_update == 'true'
49+
uses: peter-evans/create-pull-request@v5
50+
with:
51+
commit-message: "chore(deps): update @metricinsights/pp-dev to ${{ steps.check.outputs.latest }}"
52+
title: "chore(deps): update pp-dev to ${{ steps.check.outputs.latest }}"
53+
body: |
54+
Automated update of @metricinsights/pp-dev dependency.
55+
56+
- Previous: ${{ steps.check.outputs.current }}
57+
- New: ${{ steps.check.outputs.latest }}
58+
branch: deps/update-pp-dev
59+
delete-branch: true
60+

.releaserc.json

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,34 @@
77
"channel": "beta"
88
}
99
],
10-
"tagFormat": "create-pp-dev@${version}",
10+
"tagFormat": "v${version}",
1111
"plugins": [
1212
[
1313
"@semantic-release/commit-analyzer",
1414
{
15-
"preset": "angular",
16-
"presetConfig": {
17-
"issuePrefixes": [],
18-
"issueFormat": false,
19-
"issueReferences": false
20-
}
15+
"preset": "angular"
2116
}
2217
],
2318
[
2419
"@semantic-release/release-notes-generator",
2520
{
26-
"preset": "angular",
27-
"presetConfig": {
28-
"issuePrefixes": [],
29-
"commitTypes": ["feat", "fix", "docs", "style", "refactor", "perf", "test", "chore", "ci", "build"],
30-
"issueFormat": false,
31-
"issueReferences": false
32-
}
21+
"preset": "angular"
3322
}
3423
],
3524
"@semantic-release/changelog",
3625
[
3726
"@semantic-release/npm",
3827
{
39-
"npmPublish": false
28+
"npmPublish": true
4029
}
4130
],
4231
[
4332
"@semantic-release/git",
4433
{
4534
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
46-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
35+
"message": "chore(release): ${nextRelease.version} [skip ci]"
4736
}
4837
],
49-
[
50-
"@semantic-release/github",
51-
{
52-
"assets": ["package.json", "package-lock.json", "CHANGELOG.md"],
53-
"releasedLabels": false,
54-
"successComment": false,
55-
"failTitle": false,
56-
"failComment": false
57-
}
58-
]
59-
],
60-
"extends": ["semantic-release-monorepo"],
61-
"preset": "angular"
38+
"@semantic-release/github"
39+
]
6240
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@
3838
"author": "Serhii Shpak",
3939
"repository": {
4040
"type": "git",
41-
"url": "git+https://github.com/mi-examples/pp-dev-js.git"
41+
"url": "git+https://github.com/mi-examples/create-pp-dev.git"
4242
},
43+
"bugs": {
44+
"url": "https://github.com/mi-examples/create-pp-dev/issues"
45+
},
46+
"homepage": "https://github.com/mi-examples/create-pp-dev#readme",
4347
"license": "ISC",
4448
"devDependencies": {
4549
"@metricinsights/pp-dev": "^0.12.2",
@@ -50,7 +54,6 @@
5054
"@typescript-eslint/eslint-plugin": "^7.0.0",
5155
"prettier": "^3.2.5",
5256
"semantic-release": "^24.2.7",
53-
"semantic-release-monorepo": "^8.0.2",
5457
"unbuild": "^3.0.0"
5558
},
5659
"dependencies": {

0 commit comments

Comments
 (0)