Skip to content

feat: add terminal execution mode for custom commands (#24) #25

feat: add terminal execution mode for custom commands (#24)

feat: add terminal execution mode for custom commands (#24) #25

Workflow file for this run

name: Release
on:
push:
branches: [main]
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Create release PR
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish and create GitHub release
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
set -eo pipefail
VERSION=$(node -p "require('./package.json').version")
TAG="v${VERSION}"
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
echo "Tag $TAG already exists — skipping"
exit 0
fi
if git diff HEAD^ HEAD -- package.json 2>/dev/null | grep -q '"version"'; then
echo "Version changed — proceeding with release"
elif git rev-parse HEAD^ >/dev/null 2>&1; then
echo "Version unchanged in this commit — skipping"
exit 0
else
echo "First commit or unable to check diff — proceeding with release"
fi
pnpm build
pnpm package
echo "Publishing to VS Code Marketplace..."
pnpm release:marketplace
echo "Publishing to Open VSX..."
pnpm release:ovsx
rm -f git-work-grove.vsix
git tag "$TAG"
git push origin "$TAG"
gh release create "$TAG" --generate-notes --title "$TAG"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}