Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make a draft main release every friday #5006

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
61 changes: 16 additions & 45 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,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 -n 1 || 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

Expand All @@ -49,7 +35,7 @@ jobs:
--generate-notes \
--title "$NEW_VERSION" \
--draft \
--latest
--latest \
--prerelease

create-jetbrains-release:
Expand All @@ -60,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 -n 1 || 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

Expand All @@ -95,5 +66,5 @@ jobs:
--generate-notes \
--title "$NEW_VERSION" \
--draft \
--latest
--latest \
--prerelease
46 changes: 46 additions & 0 deletions .github/workflows/jetbrains-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
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
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/vscode-version-bump.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Loading