Skip to content

Commit d55780d

Browse files
committed
chore: comment out workflow steps in publish.yml for clarity and future reference
1 parent b3d67c9 commit d55780d

File tree

1 file changed

+142
-142
lines changed

1 file changed

+142
-142
lines changed

.github/workflows/publish.yml

Lines changed: 142 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,158 @@
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
1717

18-
permissions:
19-
contents: write
18+
# permissions:
19+
# contents: write
2020

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
2828

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/'
3333

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
3838

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
4949

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
5757

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
6565

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
7171

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}"
8383

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
9191

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+
# "
103103

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
121121

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+
# "
131131

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
139139

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
149149

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

Comments
 (0)