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
20 changes: 13 additions & 7 deletions .github/workflows/release-jetbrains.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,22 @@ jobs:
- name: Compute version
id: version
run: |
MAJOR_MINOR=$(grep '^pluginVersion=' apps/jetbrains/gradle.properties | cut -d= -f2 | cut -d. -f1-2)
VERSION="${MAJOR_MINOR}.${{ github.run_number }}"
# Full version is read from apps/jetbrains/gradle.properties (single source of truth).
# Bump pluginVersion in a commit before running this workflow.
VERSION=$(grep '^pluginVersion=' apps/jetbrains/gradle.properties | cut -d= -f2)
TAG="jetbrains-v${VERSION}"
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null \
|| git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "::error::Tag ${TAG} already exists. Bump pluginVersion in apps/jetbrains/gradle.properties before releasing."
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=jetbrains-v${VERSION}" >> "$GITHUB_OUTPUT"
echo "Computed version: ${VERSION}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Releasing version: ${VERSION}"

- name: Build and verify plugin
working-directory: apps/jetbrains
run: ./gradlew -PpluginVersion=${{ steps.version.outputs.version }} buildPlugin verifyPlugin --no-daemon
run: ./gradlew buildPlugin verifyPlugin --no-daemon

- name: Verify plugin zip exists
run: |
Expand All @@ -67,7 +74,7 @@ jobs:
working-directory: apps/jetbrains
env:
JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
run: ./gradlew -PpluginVersion=${{ steps.version.outputs.version }} publishPlugin --no-daemon
run: ./gradlew publishPlugin --no-daemon

- name: Configure git for tagging
if: ${{ !inputs.dry-run }}
Expand Down Expand Up @@ -99,7 +106,6 @@ jobs:
echo ""
echo "- Version: \`${{ steps.version.outputs.version }}\`"
echo "- Tag: \`${{ steps.version.outputs.tag }}\`"
echo "- Run number: \`${{ github.run_number }}\`"
if [ "${{ inputs.dry-run }}" = "true" ]; then
echo "- Mode: **dry-run** (no publish, no tag pushed, no GitHub Release)"
fi
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/release-vscode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ jobs:
- name: Compute version
id: version
run: |
# Major.minor is read from apps/vscode/package.json (single source of truth).
# Patch is the GitHub Actions run_number for this workflow (monotonic, never resets).
MAJOR_MINOR=$(node -p "require('./apps/vscode/package.json').version.split('.').slice(0,2).join('.')")
VERSION="${MAJOR_MINOR}.${{ github.run_number }}"
# Full version is read from apps/vscode/package.json (single source of truth).
# Bump it in a commit before running this workflow.
VERSION=$(node -p "require('./apps/vscode/package.json').version")
TAG="vscode-v${VERSION}"
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null \
|| git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
echo "::error::Tag ${TAG} already exists. Bump apps/vscode/package.json before releasing."
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=vscode-v${VERSION}" >> "$GITHUB_OUTPUT"
echo "Computed version: ${VERSION}"

- name: Apply version to manifest (workspace only, not committed)
working-directory: apps/vscode
run: npm version "${{ steps.version.outputs.version }}" --no-git-tag-version --allow-same-version
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Releasing version: ${VERSION}"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -89,8 +90,6 @@ jobs:
- name: Tag the release commit
if: ${{ !inputs.dry-run }}
run: |
# Discard the in-workspace version bump so the tag points at the original commit.
git checkout apps/vscode/package.json
git tag "${{ steps.version.outputs.tag }}"
git push origin "${{ steps.version.outputs.tag }}"

Expand All @@ -112,7 +111,6 @@ jobs:
echo ""
echo "- Version: \`${{ steps.version.outputs.version }}\`"
echo "- Tag: \`${{ steps.version.outputs.tag }}\`"
echo "- Run number: \`${{ github.run_number }}\`"
if [ "${{ inputs.dry-run }}" = "true" ]; then
echo "- Mode: **dry-run** (nothing published, no tag pushed)"
fi
Expand Down
Loading