Skip to content

Commit e87ca9d

Browse files
Merge pull request #653 from aXenDeveloper/build_version_package
feat: ✨ Add version bumping workflow and enhance project setup scripts
2 parents c5a2315 + 87d9702 commit e87ca9d

File tree

12 files changed

+163
-7
lines changed

12 files changed

+163
-7
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- uses: pnpm/action-setup@v4
4040
name: Install pnpm
4141
with:
42-
version: 10.8.0
42+
version: 10.10.0
4343

4444
- name: Install Node.js
4545
uses: actions/setup-node@v4

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test publish version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release:
7+
description: stable, canary, or release candidate?
8+
required: true
9+
type: choice
10+
options:
11+
- canary
12+
- stable
13+
- release-candidate
14+
type:
15+
description: 'Type of package to publish'
16+
required: true
17+
type: choice
18+
options:
19+
- patch
20+
- minor
21+
- major
22+
skip_bump_version:
23+
description: 'Skip bumping version in package.json and release notes?'
24+
required: false
25+
type: boolean
26+
27+
jobs:
28+
bump-version:
29+
name: 'Bump Version'
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: write
33+
id-token: write
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Configure Git
40+
run: |
41+
git config --global user.name "${{ github.actor }}"
42+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
43+
44+
- uses: pnpm/action-setup@v4
45+
name: Install pnpm
46+
with:
47+
version: 10.10.0
48+
49+
- name: Install Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
registry-url: 'https://registry.npmjs.org/'
53+
node-version: 22
54+
55+
- name: Install dependencies
56+
run: pnpm install --frozen-lockfile
57+
58+
- name: Run script to bump version & copy files
59+
run: pnpm run release
60+
id: version-bump
61+
env:
62+
VERSION_TYPE: ${{ github.event.inputs.type }}
63+
RELEASE_TYPE: ${{ github.event.inputs.release }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
GITHUB_USER: ${{ github.actor }}
66+
GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com

bump-version.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const ALLOWED_VERSION_TYPES = ['major', 'minor', 'patch'];
2+
const WORKSPACE = process.env.GITHUB_WORKSPACE || process.cwd();
3+
const GIT_USER = {
4+
NAME: process.env.GITHUB_USER ?? 'Automated Version Bump',
5+
EMAIL: process.env.GITHUB_EMAIL
6+
? `${process.env.GITHUB_USER}@users.noreply.github.com`
7+
8+
};
9+
10+
const init = () => {
11+
console.log(
12+
'Initializing build version script...',
13+
GIT_USER.EMAIL,
14+
GIT_USER.NAME,
15+
);
16+
};
17+
18+
init();

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "vitnode",
33
"private": true,
44
"scripts": {
5+
"release": "node ./bump-version.mjs",
56
"db:migrate": "turbo db:migrate",
67
"db:push": "turbo db:push",
78
"docker:dev": "docker compose -f ./docker-compose.yml -p vitnode-dev-dun up -d",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import vitnodePrettier from "eslint-config-typescript-vitnode/prettierrc";
2+
3+
/**
4+
* @see https://prettier.io/docs/en/configuration.html
5+
* @type {import("prettier").Config}
6+
*/
7+
const config = {
8+
...vitnodePrettier,
9+
};
10+
11+
export default config;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import eslintVitNode from 'eslint-config-typescript-vitnode/eslint';
2+
3+
export default [...eslintVitNode];
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { NextConfig } from 'next';
2+
import { vitNodeNextConfig } from '@vitnode/core/config/next.config';
3+
4+
const nextConfig: NextConfig = {
5+
experimental: {
6+
inlineCss: true,
7+
reactCompiler: true,
8+
},
9+
};
10+
11+
export default vitNodeNextConfig(nextConfig);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { buildApiConfig } from '@vitnode/core/vitnode.config';
2+
3+
export const vitNodeApiConfig = buildApiConfig({
4+
plugins: [],
5+
});

packages/create-vitnode-app/eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ export default [
77
'no-console': 'off',
88
},
99
},
10+
{
11+
ignores: ['copy-of-vitnode-app'],
12+
},
1013
];

packages/create-vitnode-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"create-vitnode-app": "dist/src/index.js"
1616
},
1717
"scripts": {
18-
"build:cli": "tsc",
18+
"build:cli": "tsc && node dist/src/prepare/prepare.js",
1919
"cli": "node dist/src/index.js",
2020
"lint": "eslint .",
2121
"lint:fix": "eslint . --fix"

0 commit comments

Comments
 (0)