Skip to content

Commit a1c3bfe

Browse files
committed
feat: support interface workflow
1 parent bcb6694 commit a1c3bfe

File tree

5 files changed

+1114
-17
lines changed

5 files changed

+1114
-17
lines changed

.github/workflows/release.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Auto Release and Publish via package version
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'package.json'
9+
10+
jobs:
11+
12+
Version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
version_changed: ${{ steps.detect.outputs.version_changed }}
16+
current_version: ${{ steps.detect.outputs.current_version }}
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 2
22+
23+
- name: Detect version change
24+
id: detect
25+
run: |
26+
CURRENT_VERSION=$(jq -r .version package.json)
27+
echo "Current version: $CURRENT_VERSION"
28+
29+
git checkout HEAD~1 -- package.json 2>/dev/null || true
30+
PREVIOUS_VERSION=$(jq -r .version package.json 2>/dev/null || echo "0.0.0")
31+
echo "Previous version: $PREVIOUS_VERSION"
32+
33+
if [[ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]]; then
34+
echo "version_changed=true" >> $GITHUB_OUTPUT
35+
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "version_changed=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
Release:
41+
needs: Version
42+
if: ${{ needs.Version.outputs.version_changed == 'true' }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout Code
46+
uses: actions/checkout@v4
47+
48+
- name: Create Tag and Release
49+
uses: actions/github-script@v6
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
script: |
54+
const version = '${{ needs.Version.outputs.current_version }}';
55+
const tagName = `v${version}`;
56+
57+
await github.rest.git.createRef({
58+
owner: context.repo.owner,
59+
repo: context.repo.repo,
60+
ref: `refs/tags/${tagName}`,
61+
sha: context.sha
62+
});
63+
64+
await github.rest.repos.createRelease({
65+
owner: context.repo.owner,
66+
repo: context.repo.repo,
67+
tag_name: tagName,
68+
name: `${tagName}`,
69+
body: "Install: https://www.npmjs.com/package/oflow-interface",
70+
draft: false,
71+
prerelease: false
72+
});
73+
74+
75+
Publish:
76+
needs: Version
77+
if: ${{ needs.Version.outputs.version_changed == 'true' }}
78+
runs-on: ubuntu-latest
79+
steps:
80+
81+
- name: Checkout Code
82+
uses: actions/checkout@v4
83+
84+
- name: Setup Node.js Environment
85+
uses: actions/setup-node@v4
86+
with:
87+
node-version: "20"
88+
registry-url: https://registry.npmjs.org/
89+
cache: "yarn"
90+
91+
- name: Install Dependencies
92+
run: yarn install --frozen-lockfile
93+
94+
- name: Run Unit Tests
95+
run: yarn test
96+
97+
- name: Build Project
98+
run: yarn build
99+
100+
- name: Publish to NPM
101+
run: npm publish
102+
env:
103+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
{
22
"name": "oflow-interface",
3-
"version": "0.8.20",
3+
"version": "0.8.21",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
88
"watch": "tsc --watch",
9-
"build": "tsc",
10-
"publish": "npm publish"
9+
"test": "echo All tests passed.",
10+
"build": "tsc"
1111
},
1212
"keywords": [],
1313
"author": "O FLow",
1414
"license": "Apache-2.0",
1515
"devDependencies": {
16+
"@babylonjs/core": "7.41.1",
1617
"@types/react": "^18",
1718
"@types/react-dom": "^18",
18-
"typescript": "^5.6.2"
19+
"antd": "5.24.1",
20+
"clsx": "2.1.1",
21+
"react": "19.1.0-canary-ff628334-20250205",
22+
"react-dom": "19.1.0-canary-ff628334-20250205",
23+
"rhine-var": "0.9.9",
24+
"typescript": "^5.6.2",
25+
"valtio": "2.1.3"
26+
},
27+
"peerDependencies": {
28+
"@babylonjs/core": "7.41.1",
29+
"antd": "5.24.1",
30+
"clsx": "2.1.1",
31+
"react": "19.1.0-canary-ff628334-20250205",
32+
"react-dom": "19.1.0-canary-ff628334-20250205",
33+
"rhine-var": "0.9.9",
34+
"valtio": "2.1.3"
1935
},
20-
"peerDependencies": {},
2136
"dependencies": {}
2237
}

src/api/service/target/step/t-step-subscriber.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {StoredRhineVar, RvPath} from "rhine-var";
1+
import { RvPath } from "rhine-var";
22
import { TStepChangeType } from "./t-step-change-type.enum";
33

44
export type TStepSubscriber = (

tsconfig.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@
3333
"paths": {
3434
"baseUrl": ["."],
3535
"@/*": ["./src/*"],
36-
"yjs": ["../oflow-space/node_modules/yjs"],
37-
"yjs/*": ["../oflow-space/node_modules/yjs/*"],
38-
"antd": ["../oflow-space/node_modules/antd"],
39-
"antd/*": ["../oflow-space/node_modules/antd/*"],
40-
"@babylonjs/*": ["../oflow-space/node_modules/@babylonjs/*"],
41-
"clsx": ["../oflow-space/node_modules/clsx"],
42-
"rhine-var": ["../oflow-space/node_modules/rhine-var"],
4336
}
4437
},
4538
"include": ["src/**/*.ts", "src/**/*.tsx"],

0 commit comments

Comments
 (0)