From 47caa2e43b25f48d14100bd2c2bed566d238ae43 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:23:16 -0700 Subject: [PATCH 01/10] make a draft main release every friday --- .github/workflows/vscode-version-bump.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/vscode-version-bump.yml b/.github/workflows/vscode-version-bump.yml index 39dc5b7f17..4c9ebf1a2e 100644 --- a/.github/workflows/vscode-version-bump.yml +++ b/.github/workflows/vscode-version-bump.yml @@ -15,6 +15,10 @@ jobs: with: fetch-depth: 0 # Fetch all history and tags + - name: Setup GitHub CLI + run: | + gh auth login --with-token <<< "${{ github.token }}" + - name: Use Node.js from .nvmrc uses: actions/setup-node@v4 with: @@ -97,6 +101,15 @@ jobs: echo "Pushing branch to origin..." git push origin $NEW_BRANCH + # Add release creation + echo "Creating draft release..." + gh release create "${NEW_BRANCH}" \ + --title "${NEW_BRANCH}" \ + --generate-notes \ + --draft \ + --latest \ + --notes-start-tag "${LAST_1_0_TAG}" + echo "Version bump process completed successfully!" - name: Check for errors From 290b7e0b84f62a6debf9f161a6e92ea7af80e34b Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:24:13 -0700 Subject: [PATCH 02/10] fix grep error --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 5985624dec..c1e8c8e3d3 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -20,7 +20,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-vscode$" | head -n 1 || echo "v1.1.0-vscode") + latest_tag=$(git tag --sort=-creatordate | grep "-vscode$" || echo "v1.1.0-vscode") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV @@ -66,7 +66,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-jetbrains$" | head -n 1 || echo "v1.1.0-jetbrains") + latest_tag=$(git tag --sort=-creatordate | grep "-jetbrains$" || echo "v1.1.0-jetbrains") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV From 03279380e40fe0da9916aa663b6a94e33f600cb9 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:24:49 -0700 Subject: [PATCH 03/10] run on push for testing --- .github/workflows/auto-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index c1e8c8e3d3..bab22f2f52 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -1,6 +1,9 @@ name: Create Automatic Release on: + push: + branches: + - nate/auto-main-release-draft schedule: - cron: "0 17 * * 1,3,5" # Run at 9am PST (17:00 UTC) on Monday, Wednesday, Friday workflow_dispatch: # Keep manual trigger option From 46cbbee7b007c4361cfa6c407d29cde2e51e5454 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:27:06 -0700 Subject: [PATCH 04/10] fix? --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index bab22f2f52..3c7182ec3c 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep "-vscode$" || echo "v1.1.0-vscode") + latest_tag=$(git tag --sort=-creatordate | grep -E "-vscode$" || echo "v1.1.0-vscode") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV @@ -69,7 +69,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep "-jetbrains$" || echo "v1.1.0-jetbrains") + latest_tag=$(git tag --sort=-creatordate | grep -E "-jetbrains$" || echo "v1.1.0-jetbrains") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV From c296d4b435383eb76338a412a5060c77ac49a303 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:30:41 -0700 Subject: [PATCH 05/10] fix again --- .github/workflows/auto-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 3c7182ec3c..3752fb2d32 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-vscode$" || echo "v1.1.0-vscode") + latest_tag=$(git tag --sort=-creatordate | grep -E '-vscode$' || echo "v1.1.0-vscode") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV @@ -52,7 +52,7 @@ jobs: --generate-notes \ --title "$NEW_VERSION" \ --draft \ - --latest + --latest \ --prerelease create-jetbrains-release: @@ -69,7 +69,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E "-jetbrains$" || echo "v1.1.0-jetbrains") + latest_tag=$(git tag --sort=-creatordate | grep -E '-jetbrains$' || echo "v1.1.0-jetbrains") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV @@ -98,5 +98,5 @@ jobs: --generate-notes \ --title "$NEW_VERSION" \ --draft \ - --latest + --latest \ --prerelease From 80c9911aef06d29f3d3e1db6fbae9ae9c1666084 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:32:40 -0700 Subject: [PATCH 06/10] actual fix --- .github/workflows/auto-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 3752fb2d32..ab99809cae 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,7 +23,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '-vscode$' || echo "v1.1.0-vscode") + latest_tag=$(git tag --sort=-creatordate | grep -E '\-vscode$' || echo "v1.1.0-vscode") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV @@ -69,7 +69,7 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '-jetbrains$' || echo "v1.1.0-jetbrains") + latest_tag=$(git tag --sort=-creatordate | grep -E '\-jetbrains$' || echo "v1.1.0-jetbrains") echo "Latest tag: $latest_tag" echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV From 79ca0fa25ad7cd4c4f36f7788edc9177da565461 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 16:37:03 -0700 Subject: [PATCH 07/10] another fix --- .github/workflows/auto-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index ab99809cae..2226fccb0c 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -23,9 +23,9 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '\-vscode$' || echo "v1.1.0-vscode") + latest_tag=$(git tag --sort=-creatordate | grep -E '\-vscode$' | head -n1 || echo "v1.1.0-vscode") echo "Latest tag: $latest_tag" - echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV + echo "LATEST_TAG=${latest_tag}" >> "$GITHUB_ENV" - name: Generate next version id: generate_version @@ -69,9 +69,9 @@ jobs: id: get_latest_tag run: | # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '\-jetbrains$' || echo "v1.1.0-jetbrains") + latest_tag=$(git tag --sort=-creatordate | grep -E '\-jetbrains$' | head -n1 || echo "v1.1.0-jetbrains") echo "Latest tag: $latest_tag" - echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV + echo "LATEST_TAG=${latest_tag}" >> "$GITHUB_ENV" - name: Generate next version id: generate_version From 7215bccddecc8c8083b131f43b9b8bed79948d03 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 19:50:29 -0700 Subject: [PATCH 08/10] use version from gradle.properties and package.json --- .github/workflows/auto-release.yml | 54 ++++++------------------------ 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 2226fccb0c..43d65d5b5f 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -16,30 +16,13 @@ jobs: steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Important for getting all tags and commits - - - name: Get latest tag - id: get_latest_tag - run: | - # Get the latest tag ending in -vscode or default to v1.1.0-vscode if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '\-vscode$' | head -n1 || echo "v1.1.0-vscode") - echo "Latest tag: $latest_tag" - echo "LATEST_TAG=${latest_tag}" >> "$GITHUB_ENV" - - name: Generate next version - id: generate_version + - name: Get version from package.json + id: get_version run: | - # Extract version numbers (handle the -vscode suffix) - version=${LATEST_TAG#v} # Remove v prefix - version=${version%-vscode} # Remove -vscode suffix - IFS='.' read -ra VERSION_PARTS <<< "$version" - - # Increment patch version - ((VERSION_PARTS[2]++)) - - # Create new version string with -vscode suffix - new_version="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}-vscode" + # Read version from package.json and add -vscode suffix + version=$(node -p "require('./extensions/vscode/package.json').version") + new_version="v${version}-vscode" echo "New version will be: $new_version" echo "NEW_VERSION=$new_version" >> $GITHUB_ENV @@ -63,29 +46,14 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Important for getting all tags and commits + fetch-depth: 0 - - name: Get latest tag - id: get_latest_tag + - name: Get version from gradle.properties + id: get_version run: | - # Get the latest tag ending in -jetbrains or default to v1.1.0-jetbrains if none exists - latest_tag=$(git tag --sort=-creatordate | grep -E '\-jetbrains$' | head -n1 || echo "v1.1.0-jetbrains") - echo "Latest tag: $latest_tag" - echo "LATEST_TAG=${latest_tag}" >> "$GITHUB_ENV" - - - name: Generate next version - id: generate_version - run: | - # Extract version numbers (handle the -jetbrains suffix) - version=${LATEST_TAG#v} # Remove v prefix - version=${version%-jetbrains} # Remove -jetbrains suffix - IFS='.' read -ra VERSION_PARTS <<< "$version" - - # Increment patch version - ((VERSION_PARTS[2]++)) - - # Create new version string with -jetbrains suffix - new_version="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}-jetbrains" + # Read version from gradle.properties and add -jetbrains suffix + version=$(grep '^pluginVersion=' extensions/intellij/gradle.properties | cut -d'=' -f2) + new_version="v${version}-jetbrains" echo "New version will be: $new_version" echo "NEW_VERSION=$new_version" >> $GITHUB_ENV From 05899e2d68d72f2750233ed5a0dce658e454e631 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 19:51:20 -0700 Subject: [PATCH 09/10] rename --- .github/workflows/vscode-version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vscode-version-bump.yml b/.github/workflows/vscode-version-bump.yml index 4c9ebf1a2e..c05da185f2 100644 --- a/.github/workflows/vscode-version-bump.yml +++ b/.github/workflows/vscode-version-bump.yml @@ -1,4 +1,4 @@ -name: VS Code Extension Version Bump +name: Create VS Code main release draft on: schedule: # Runs at 7 AM PST (15:00 UTC) every Friday From 9fcf958d526b15332ed16e014272faa33499640d Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 5 Apr 2025 20:10:09 -0700 Subject: [PATCH 10/10] bump jb version automatically --- .github/workflows/jetbrains-release.yaml | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/jetbrains-release.yaml b/.github/workflows/jetbrains-release.yaml index a968dcc19b..058d6191b7 100644 --- a/.github/workflows/jetbrains-release.yaml +++ b/.github/workflows/jetbrains-release.yaml @@ -37,6 +37,52 @@ jobs: echo "should_run=false" >> $GITHUB_OUTPUT fi + bump-version: + runs-on: ubuntu-latest + needs: + - check_release_name + if: github.event_name != 'workflow_dispatch' || github.event.inputs.publish_build == 'true' + permissions: + contents: write + pull-requests: write + steps: + # 0. Setup git + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Create PR branch + run: | + BRANCH_NAME="chore/bump-jetbrains-version-$(date +%Y%m%d-%H%M%S)" + git checkout -b $BRANCH_NAME + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + + - name: Bump version in gradle.properties + run: | + cd extensions/intelllij + awk '/pluginVersion=/{split($0,a,"="); split(a[2],b,"."); b[3]+=1; printf "%s=%s.%s.%s\n",a[1],b[1],b[2],b[3];next}1' gradle.properties > tmp && mv tmp gradle.properties + rm -rf tmp + NEW_VERSION=$(grep 'pluginVersion=' gradle.properties | cut -d'=' -f2) + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.CI_GITHUB_TOKEN }} + commit-message: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + title: "chore: bump jetbrains extension version to ${{ env.NEW_VERSION }}" + body: | + Automated PR to bump the JetBrains extension version after successful pre-release publication. + + - Bumped version in extensions/intellij/gradle.properties to ${{ env.NEW_VERSION }} + branch: ${{ env.BRANCH_NAME }} + base: main + delete-branch: true + # Prepare and publish the plugin to JetBrains Marketplace repository build: needs: check_release_name