1
- name : Publish to NPM
2
- on :
3
- push :
4
- branches :
5
- - main
6
- - develop
7
- workflow_dispatch :
8
- inputs :
9
- release_type :
10
- description : ' Release type (stable/alpha)'
11
- required : true
12
- default : ' stable'
13
- type : choice
14
- options :
15
- - stable
16
- - alpha
1
+ # name: Publish to NPM
2
+ # on:
3
+ # push:
4
+ # branches:
5
+ # - main
6
+ # - develop
7
+ # workflow_dispatch:
8
+ # inputs:
9
+ # release_type:
10
+ # description: 'Release type (stable/alpha)'
11
+ # required: true
12
+ # default: 'stable'
13
+ # type: choice
14
+ # options:
15
+ # - stable
16
+ # - alpha
17
17
18
- permissions :
19
- contents : write
18
+ # permissions:
19
+ # contents: write
20
20
21
- jobs :
22
- version-and-publish :
23
- runs-on : ubuntu-latest
24
- steps :
25
- - uses : actions/checkout@v4
26
- with :
27
- fetch-depth : 0
21
+ # jobs:
22
+ # version-and-publish:
23
+ # runs-on: ubuntu-latest
24
+ # steps:
25
+ # - uses: actions/checkout@v4
26
+ # with:
27
+ # fetch-depth: 0
28
28
29
- - uses : actions/setup-node@v4
30
- with :
31
- node-version : ' 20.x'
32
- registry-url : ' https://registry.npmjs.org/'
29
+ # - uses: actions/setup-node@v4
30
+ # with:
31
+ # node-version: '20.x'
32
+ # registry-url: 'https://registry.npmjs.org/'
33
33
34
- - name : Install pnpm
35
- uses : pnpm/action-setup@v2
36
- with :
37
- version : 8
34
+ # - name: Install pnpm
35
+ # uses: pnpm/action-setup@v2
36
+ # with:
37
+ # version: 8
38
38
39
- - name : Set Release Type
40
- id : release_type
41
- run : |
42
- if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
43
- echo "type=alpha" >> $GITHUB_OUTPUT
44
- elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
45
- echo "type=stable" >> $GITHUB_OUTPUT
46
- else
47
- echo "type=${{ inputs.release_type }}" >> $GITHUB_OUTPUT
48
- fi
39
+ # - name: Set Release Type
40
+ # id: release_type
41
+ # run: |
42
+ # if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
43
+ # echo "type=alpha" >> $GITHUB_OUTPUT
44
+ # elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
45
+ # echo "type=stable" >> $GITHUB_OUTPUT
46
+ # else
47
+ # echo "type=${{ inputs.release_type }}" >> $GITHUB_OUTPUT
48
+ # fi
49
49
50
- - name : Install Dependencies
51
- run : |
52
- if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
53
- pnpm run preinstall:develop && pnpm install
54
- else
55
- pnpm run preinstall:stable && pnpm install
56
- fi
50
+ # - name: Install Dependencies
51
+ # run: |
52
+ # if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
53
+ # pnpm run preinstall:develop && pnpm install
54
+ # else
55
+ # pnpm run preinstall:stable && pnpm install
56
+ # fi
57
57
58
- - name : Build
59
- run : |
60
- if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
61
- pnpm run build:develop
62
- else
63
- pnpm run build:stable
64
- fi
58
+ # - name: Build
59
+ # run: |
60
+ # if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
61
+ # pnpm run build:develop
62
+ # else
63
+ # pnpm run build:stable
64
+ # fi
65
65
66
- - name : Get current version
67
- id : current_version
68
- run : |
69
- CURRENT_VERSION=$(node -p "require('./package.json').version")
70
- echo "version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
66
+ # - name: Get current version
67
+ # id: current_version
68
+ # run: |
69
+ # CURRENT_VERSION=$(node -p "require('./package.json').version")
70
+ # echo "version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
71
71
72
- - name : Calculate new version
73
- id : new_version
74
- run : |
75
- CURRENT_VERSION="${{ steps.current_version.outputs.version }}"
76
- if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
77
- # Strip any existing alpha suffix
78
- BASE_VERSION=${CURRENT_VERSION%-alpha*}
79
- # Split version into parts
80
- IFS='.' read -r -a version_parts <<< "$BASE_VERSION"
81
- PATCH=$((version_parts[2] + 1))
82
- NEW_VERSION="${version_parts[0]}.${version_parts[1]}.${PATCH}"
72
+ # - name: Calculate new version
73
+ # id: new_version
74
+ # run: |
75
+ # CURRENT_VERSION="${{ steps.current_version.outputs.version }}"
76
+ # if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
77
+ # # Strip any existing alpha suffix
78
+ # BASE_VERSION=${CURRENT_VERSION%-alpha*}
79
+ # # Split version into parts
80
+ # IFS='.' read -r -a version_parts <<< "$BASE_VERSION"
81
+ # PATCH=$((version_parts[2] + 1))
82
+ # NEW_VERSION="${version_parts[0]}.${version_parts[1]}.${PATCH}"
83
83
84
- if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
85
- NEW_VERSION="${NEW_VERSION}-alpha.1"
86
- fi
87
- else
88
- NEW_VERSION="$CURRENT_VERSION"
89
- fi
90
- echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT
84
+ # if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
85
+ # NEW_VERSION="${NEW_VERSION}-alpha.1"
86
+ # fi
87
+ # else
88
+ # NEW_VERSION="$CURRENT_VERSION"
89
+ # fi
90
+ # echo "version=${NEW_VERSION}" >> $GITHUB_OUTPUT
91
91
92
- - name : Update package.json
93
- if : github.event_name == 'workflow_dispatch'
94
- run : |
95
- NEW_VERSION="${{ steps.new_version.outputs.version }}"
96
- # Use node to update package.json to preserve formatting
97
- node -e "
98
- const fs = require('fs');
99
- const package = JSON.parse(fs.readFileSync('package.json'));
100
- package.version = '$NEW_VERSION';
101
- fs.writeFileSync('package.json', JSON.stringify(package, null, 2) + '\n');
102
- "
92
+ # - name: Update package.json
93
+ # if: github.event_name == 'workflow_dispatch'
94
+ # run: |
95
+ # NEW_VERSION="${{ steps.new_version.outputs.version }}"
96
+ # # Use node to update package.json to preserve formatting
97
+ # node -e "
98
+ # const fs = require('fs');
99
+ # const package = JSON.parse(fs.readFileSync('package.json'));
100
+ # package.version = '$NEW_VERSION';
101
+ # fs.writeFileSync('package.json', JSON.stringify(package, null, 2) + '\n');
102
+ # "
103
103
104
- - name : Get Package Version
105
- id : package_version
106
- run : |
107
- VERSION=$(node -p "require('./package.json').version")
108
- if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
109
- # Extract existing alpha number if it exists
110
- if [[ $VERSION =~ -alpha\.([0-9]+)$ ]]; then
111
- ALPHA_NUM=${BASH_REMATCH[1]}
112
- NEW_ALPHA_NUM=$((ALPHA_NUM + 1))
113
- # Remove existing alpha suffix and add new one
114
- VERSION="${VERSION%-alpha.*}-alpha.$NEW_ALPHA_NUM"
115
- else
116
- # No existing alpha number, start with 1
117
- VERSION="${VERSION}-alpha.1"
118
- fi
119
- fi
120
- echo "version=${VERSION}" >> $GITHUB_OUTPUT
104
+ # - name: Get Package Version
105
+ # id: package_version
106
+ # run: |
107
+ # VERSION=$(node -p "require('./package.json').version")
108
+ # if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
109
+ # # Extract existing alpha number if it exists
110
+ # if [[ $VERSION =~ -alpha\.([0-9]+)$ ]]; then
111
+ # ALPHA_NUM=${BASH_REMATCH[1]}
112
+ # NEW_ALPHA_NUM=$((ALPHA_NUM + 1))
113
+ # # Remove existing alpha suffix and add new one
114
+ # VERSION="${VERSION%-alpha.*}-alpha.$NEW_ALPHA_NUM"
115
+ # else
116
+ # # No existing alpha number, start with 1
117
+ # VERSION="${VERSION}-alpha.1"
118
+ # fi
119
+ # fi
120
+ # echo "version=${VERSION}" >> $GITHUB_OUTPUT
121
121
122
- - name : Update package.json with version
123
- run : |
124
- # Use node to update package.json to preserve formatting
125
- node -e "
126
- const fs = require('fs');
127
- const package = JSON.parse(fs.readFileSync('package.json'));
128
- package.version = '${{ steps.package_version.outputs.version }}';
129
- fs.writeFileSync('package.json', JSON.stringify(package, null, 2) + '\n');
130
- "
122
+ # - name: Update package.json with version
123
+ # run: |
124
+ # # Use node to update package.json to preserve formatting
125
+ # node -e "
126
+ # const fs = require('fs');
127
+ # const package = JSON.parse(fs.readFileSync('package.json'));
128
+ # package.version = '${{ steps.package_version.outputs.version }}';
129
+ # fs.writeFileSync('package.json', JSON.stringify(package, null, 2) + '\n');
130
+ # "
131
131
132
- - name : Commit version update
133
- run : |
134
- git config user.name 'github-actions[bot]'
135
- git config user.email 'github-actions[bot]@users.noreply.github.com'
136
- git add package.json
137
- git commit -m "chore: update package.json version to ${{ steps.package_version.outputs.version }}"
138
- git push
132
+ # - name: Commit version update
133
+ # run: |
134
+ # git config user.name 'github-actions[bot]'
135
+ # git config user.email 'github-actions[bot]@users.noreply.github.com'
136
+ # git add package.json
137
+ # git commit -m "chore: update package.json version to ${{ steps.package_version.outputs.version }}"
138
+ # git push
139
139
140
- - name : Create Release
141
- env :
142
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
143
- run : |
144
- RELEASE_TAG="v${{ steps.package_version.outputs.version }}"
145
- gh release create $RELEASE_TAG \
146
- --target=$GITHUB_SHA \
147
- --title="$RELEASE_TAG" \
148
- --generate-notes
140
+ # - name: Create Release
141
+ # env:
142
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143
+ # run: |
144
+ # RELEASE_TAG="v${{ steps.package_version.outputs.version }}"
145
+ # gh release create $RELEASE_TAG \
146
+ # --target=$GITHUB_SHA \
147
+ # --title="$RELEASE_TAG" \
148
+ # --generate-notes
149
149
150
- - name : Publish
151
- env :
152
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
153
- run : |
154
- if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
155
- pnpm publish --access=public --tag alpha --no-git-checks
156
- else
157
- pnpm publish --access=public --no-git-checks
158
- fi
150
+ # - name: Publish
151
+ # env:
152
+ # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
153
+ # run: |
154
+ # if [[ "${{ steps.release_type.outputs.type }}" == "alpha" ]]; then
155
+ # pnpm publish --access=public --tag alpha --no-git-checks
156
+ # else
157
+ # pnpm publish --access=public --no-git-checks
158
+ # fi
0 commit comments