Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
echo "is_tag=false" >> $GITHUB_OUTPUT
echo "is_dry_run=true" >> $GITHUB_OUTPUT
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "tag=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
# Add 'v' prefix to match release tag format
echo "tag=v$PACKAGE_VERSION" >> $GITHUB_OUTPUT
echo "Triggered by master branch push (dry-run mode)"
echo "Using version from package.json: $PACKAGE_VERSION"
echo "Using version from package.json: v$PACKAGE_VERSION"
fi

- name: Validate tag format and determine release type
Expand All @@ -40,8 +41,8 @@ jobs:
TAG="${{ steps.trigger_type.outputs.tag }}"
IS_DRY_RUN="${{ steps.trigger_type.outputs.is_dry_run }}"

# Check if tag matches stable release pattern (e.g., 1.0.3)
if echo "$TAG" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
# Check if tag matches stable release pattern (e.g., v1.0.3)
if echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "is_stable_release=true" >> $GITHUB_OUTPUT
echo "is_prerelease=false" >> $GITHUB_OUTPUT
echo "should_publish=true" >> $GITHUB_OUTPUT
Expand All @@ -50,8 +51,8 @@ jobs:
else
echo "Tag is a stable release: $TAG"
fi
# Check if tag matches pre-release pattern (e.g., 1.0.3-alpha, 1.0.3-beta, 1.0.3-rc.1)
elif echo "$TAG" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-.+$'; then
# Check if tag matches pre-release pattern (e.g., v1.0.3-pre, v1.0.3-alpha, v1.0.3-rc.1)
elif echo "$TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+-.+$'; then
echo "is_stable_release=false" >> $GITHUB_OUTPUT
echo "is_prerelease=true" >> $GITHUB_OUTPUT
echo "should_publish=true" >> $GITHUB_OUTPUT
Expand All @@ -77,8 +78,8 @@ jobs:
if: steps.validate_tag.outputs.should_publish == 'true'
run: |
TAG="${{ steps.trigger_type.outputs.tag }}"
# Extract the version number (e.g., 1.0.3 from 1.0.3 or 1.0.3-alpha)
VERSION=$(echo "$TAG" | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
# Extract the version number (e.g., 1.0.3 from v1.0.3 or v1.0.3-pre)
VERSION=$(echo "$TAG" | sed 's/^v//' | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION"

Expand Down
45 changes: 4 additions & 41 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,6 @@
#!/usr/bin/env bash
# Wrapper script for backward compatibility
# Use tasks.sh directly for more options: ./tasks.sh --help

function installUtils() {
if command -v brew; then
brew install $@
elif command -v apt; then
apt install $@
elif command -v yum; then
yum install $@
fi
}

if ! command -v node; then
if command -v winget; then
if winget install OpenJS.NodeJS.LTS; then
echo "Install OpenJS.NodeJS.LTS Successfully, Please run the shell script again."
exit 0
fi
else
installUtils node
if ! command -v npm; then
# windows 下 npm 和 nodejs 在一个包里面
installUtils npm
fi
fi

if ! command -v node; then
if bash -c "command -v npm"; then
echo "Can not find nodejs. Please try again."
fi
fi
fi

if ! command -v vsce; then
npm install -g vsce
fi

cd "$(dirname "$0")"

npm install

git clean -ffdx dist *.vsix
vsce package
cd "$(dirname "$0")" || exit 1
exec ./tasks.sh --build "$@"
6 changes: 6 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Wrapper script for backward compatibility
# Use tasks.sh directly for more options: ./tasks.sh --help

cd "$(dirname "$0")" || exit 1
exec ./tasks.sh --publish "$@"
Loading