Skip to content

Commit 21250c9

Browse files
Feat/virto oz (#214)
1 parent 6270dab commit 21250c9

File tree

134 files changed

+8072
-646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+8072
-646
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Virto-shell CI
44
on:
55
workflow_dispatch:
66
push:
7-
branches: [ main ]
7+
branches: [ main, feat/virto-oz ]
88
# Only on commits with package changes or release commits
99
paths:
1010
- 'framework/**'
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
# Only runs on release commits, releases, or manual dispatch
2222
if: |
23-
github.event_name == 'release' ||
23+
github.event_name == 'release' ||
2424
github.event_name == 'workflow_dispatch' ||
2525
contains(github.event.head_commit.message, 'release:') ||
2626
contains(github.event.head_commit.message, 'chore: release')
@@ -94,57 +94,10 @@ jobs:
9494
- name: Determine npm tag
9595
if: success()
9696
run: |
97-
echo "Determining npm tag for publishing..."
98-
99-
# Get current version from framework package
100-
CURRENT_VERSION=$(node -p "require('./framework/package.json').version")
101-
echo "Current version: $CURRENT_VERSION"
102-
103-
# Strategy 1: Get npm tag from git tag (most reliable)
104-
GIT_TAG=$(git describe --tags --exact-match HEAD 2>/dev/null || echo "")
105-
if [ ! -z "$GIT_TAG" ]; then
106-
echo "Found git tag: $GIT_TAG"
107-
# Extract npm tag from git tag (e.g., v1.1.98-rc.3 -> rc)
108-
if [[ "$GIT_TAG" == *"-rc"* ]]; then
109-
NPM_TAG="rc"
110-
elif [[ "$GIT_TAG" == *"-alpha"* ]]; then
111-
NPM_TAG="alpha"
112-
elif [[ "$GIT_TAG" == *"-beta"* ]]; then
113-
NPM_TAG="beta"
114-
elif [[ "$GIT_TAG" == *"-next"* ]]; then
115-
NPM_TAG="next"
116-
else
117-
NPM_TAG="latest"
118-
fi
119-
echo "Using npm tag from git tag: $NPM_TAG"
120-
else
121-
# Strategy 2: Analyze version pattern (fallback)
122-
if [[ "$CURRENT_VERSION" == *"-rc"* ]]; then
123-
NPM_TAG="rc"
124-
elif [[ "$CURRENT_VERSION" == *"-alpha"* ]]; then
125-
NPM_TAG="alpha"
126-
elif [[ "$CURRENT_VERSION" == *"-beta"* ]]; then
127-
NPM_TAG="beta"
128-
elif [[ "$CURRENT_VERSION" == *"-next"* ]]; then
129-
NPM_TAG="next"
130-
else
131-
NPM_TAG="latest"
132-
fi
133-
echo "Using version-based tag (no git tag found): $NPM_TAG"
134-
fi
135-
136-
# Strategy 3: Check commit message for explicit tag (override)
137-
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
138-
if [[ "$COMMIT_MESSAGE" == *"npmTag:"* ]]; then
139-
COMMIT_TAG=$(echo "$COMMIT_MESSAGE" | grep -o "npmTag:[a-zA-Z0-9-]*" | cut -d: -f2)
140-
if [ ! -z "$COMMIT_TAG" ]; then
141-
NPM_TAG="$COMMIT_TAG"
142-
echo "Using tag from commit message (override): $NPM_TAG"
143-
fi
144-
fi
145-
97+
VERSION=$(node -p "require('./framework/package.json').version")
98+
NPM_TAG=$(node -e "const m='$VERSION'.match(/-(alpha|beta|rc|next)/); console.log(m?m[1]:'latest')")
99+
echo "Version: $VERSION → npm tag: $NPM_TAG"
146100
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV
147-
echo "Final npm tag: $NPM_TAG"
148101
149102
- name: Publish with Lerna
150103
if: success()
@@ -164,7 +117,7 @@ jobs:
164117
run: |
165118
echo "Verifying npm dist tags..."
166119
echo "Published packages with tag: $NPM_TAG"
167-
120+
168121
# Show current tags for verification
169122
PACKAGES=(
170123
"@vc-shell/framework"
@@ -174,7 +127,7 @@ jobs:
174127
"@vc-shell/config-generator"
175128
"@vc-shell/api-client-generator"
176129
)
177-
130+
178131
for PACKAGE in "${PACKAGES[@]}"; do
179132
echo "Tags for $PACKAGE:"
180133
npm dist-tag ls "$PACKAGE" 2>/dev/null || echo "Package not found in npm"

0 commit comments

Comments
 (0)