Skip to content

Commit afd2daf

Browse files
committed
Merge main into fix-token-plain-text-display branch
2 parents 7472fe1 + 2c8014b commit afd2daf

File tree

88 files changed

+1678
-672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1678
-672
lines changed

.github/dependabot.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Dependabot configuration:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Maintain dependencies for Gradle dependencies
7+
- package-ecosystem: "gradle"
8+
directory: "/"
9+
target-branch: "main"
10+
schedule:
11+
interval: "weekly"
12+
time: "06:00"
13+
timezone: "America/Chicago"
14+
ignore:
15+
# these depend on the toolbox API and should be updated manually
16+
- dependency-name: "org.jetbrains.kotlin.jvm"
17+
- dependency-name: "org.jetbrains.kotlin.plugin.serialization"
18+
- dependency-name: "com.google.devtools.ksp"
19+
# these can have breaking changes
20+
- dependency-name: "com.jetbrains.toolbox:core-api"
21+
- dependency-name: "com.jetbrains.toolbox:ui-api"
22+
- dependency-name: "com.jetbrains.toolbox:remote-dev-api"
23+
commit-message:
24+
prefix: "chore"
25+
# Maintain dependencies for GitHub Actions
26+
- package-ecosystem: "github-actions"
27+
directory: "/"
28+
target-branch: "main"
29+
schedule:
30+
interval: "weekly"
31+
time: "06:00"
32+
timezone: "America/Chicago"
33+
commit-message:
34+
prefix: "chore"

.github/workflows/build.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# GitHub Actions workflow for testing and preparing the plugin release.
2+
# GitHub Actions reference: https://help.github.com/en/actions
3+
4+
name: Coder Toolbox Plugin Build
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
12+
jobs:
13+
# Run plugin tests on every supported platform.
14+
test:
15+
strategy:
16+
matrix:
17+
platform:
18+
- ubuntu-latest
19+
- macos-latest
20+
- windows-latest
21+
runs-on: ${{ matrix.platform }}
22+
steps:
23+
- uses: actions/[email protected]
24+
25+
- uses: actions/setup-java@v4
26+
with:
27+
distribution: zulu
28+
java-version: 21
29+
cache: gradle
30+
31+
- uses: gradle/[email protected]
32+
33+
# Run tests
34+
- run: ./gradlew test --info
35+
36+
# Collect Tests Result of failed tests
37+
- if: ${{ failure() }}
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: tests-result
41+
path: ${{ github.workspace }}/build/reports/tests
42+
43+
build:
44+
name: Build
45+
needs: test
46+
runs-on: ubuntu-latest
47+
outputs:
48+
version: ${{ steps.properties.outputs.version }}
49+
changelog: ${{ steps.properties.outputs.changelog }}
50+
steps:
51+
# Check out current repository
52+
- name: Fetch Sources
53+
uses: actions/[email protected]
54+
55+
# Setup Java 21 environment for the next steps
56+
- name: Setup Java
57+
uses: actions/setup-java@v4
58+
with:
59+
distribution: zulu
60+
java-version: 21
61+
cache: gradle
62+
63+
# Set environment variables
64+
- name: Export Properties
65+
id: properties
66+
shell: bash
67+
run: |
68+
PROPERTIES="$(./gradlew properties --console=plain -q)"
69+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
70+
NAME="$(echo "$PROPERTIES" | grep "^group:" | cut -f2- -d ' ')"
71+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
72+
echo "version=$VERSION" >> $GITHUB_OUTPUT
73+
echo "name=$NAME" >> $GITHUB_OUTPUT
74+
echo "$CHANGELOG" > RELEASE_NOTES.md
75+
76+
# Run plugin build
77+
- name: Run Build
78+
run: ./gradlew clean pluginZip --info
79+
80+
# Prepare plugin archive content for creating artifact
81+
- name: Prepare Plugin Artifact
82+
id: artifact
83+
shell: bash
84+
run: |
85+
cd ${{ github.workspace }}/build/distributions
86+
FILENAME=$(ls *.zip)
87+
unzip "$FILENAME" -d content
88+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
89+
90+
# Store already-built plugin as an artifact for downloading
91+
- name: Upload artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ${{ steps.artifact.outputs.filename }}
95+
path: ./build/distributions/content/*/*
96+
97+
# Prepare a draft release for GitHub Releases page for the manual verification
98+
# If accepted and published, release workflow would be triggered
99+
releaseDraft:
100+
name: Release Draft
101+
if: github.event_name != 'pull_request'
102+
needs: build
103+
runs-on: ubuntu-latest
104+
steps:
105+
106+
# Check out current repository
107+
- name: Fetch Sources
108+
uses: actions/[email protected]
109+
110+
# Remove old release drafts by using GitHub CLI
111+
- name: Remove Old Release Drafts
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
run: |
115+
gh api repos/${{ github.repository }}/releases \
116+
--jq '.[] | select(.draft == true) | .id' \
117+
| xargs -I '{}' gh api -X DELETE repos/${{ github.repository }}/releases/{}
118+
119+
- name: Download Build Artifacts
120+
uses: actions/download-artifact@v4
121+
with:
122+
name: release-artifacts
123+
path: artifacts/
124+
125+
# Create new release draft - which is not publicly visible and requires manual acceptance
126+
- name: Create Release Draft
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
run: |
130+
gh release create v${{ needs.build.outputs.version }} \
131+
--draft artifacts/* \
132+
--target ${GITHUB_REF_NAME} \
133+
--title "v${{ needs.build.outputs.version }}" \
134+
--notes-file RELEASE_NOTES.md

.github/workflows/release.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
2+
3+
name: Release
4+
on:
5+
release:
6+
types: [ prereleased, released ]
7+
8+
jobs:
9+
10+
# Prepare and publish the plugin to the Marketplace repository
11+
release:
12+
name: Publish Plugin
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
# Check out current repository
17+
- name: Fetch Sources
18+
uses: actions/[email protected]
19+
with:
20+
ref: ${{ github.event.release.tag_name }}
21+
22+
# Setup Java 21 environment for the next steps
23+
- name: Setup Java
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: zulu
27+
java-version: 21
28+
cache: gradle
29+
30+
# Set environment variables
31+
- name: Export Properties
32+
id: properties
33+
shell: bash
34+
run: |
35+
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
36+
${{ github.event.release.body }}
37+
EOM
38+
)"
39+
40+
CHANGELOG="${CHANGELOG//'%'/'%25'}"
41+
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
42+
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
43+
44+
echo "changelog=$CHANGELOG" >> $GITHUB_OUTPUT
45+
46+
# Update Unreleased section with the current release note
47+
- name: Patch Changelog
48+
if: ${{ steps.properties.outputs.changelog != '' }}
49+
env:
50+
CHANGELOG: ${{ steps.properties.outputs.changelog }}
51+
run: |
52+
./gradlew patchChangelog --release-note="$CHANGELOG"
53+
54+
# Publish the plugin to the Marketplace
55+
# TODO - enable this step (by removing the `if` block) when JetBrains is clear about release procedures
56+
- name: Publish Plugin
57+
if: false
58+
env:
59+
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
60+
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
61+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
62+
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
63+
run: ./gradlew publishPlugin --info
64+
65+
# Upload artifact as a release asset
66+
- name: Upload Release Asset
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
70+
71+
# Create pull request
72+
- name: Create Pull Request
73+
if: ${{ steps.properties.outputs.changelog != '' }}
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
run: |
77+
VERSION="${{ github.event.release.tag_name }}"
78+
BRANCH="changelog-update-$VERSION"
79+
80+
git config user.email "[email protected]"
81+
git config user.name "GitHub Action"
82+
83+
git checkout -b $BRANCH
84+
git commit -am "Changelog update - $VERSION"
85+
git push --set-upstream origin $BRANCH
86+
87+
gh pr create \
88+
--title "Changelog update - \`$VERSION\`" \
89+
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
90+
--base main \
91+
--head $BRANCH

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ build
44
jvm/
55

66
# IntelliJ IDEA
7-
.idea
7+
.idea
8+
9+
# hidden macOS metadata files
10+
.DS_Store

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Coder Toolbox Plugin Changelog
2+
3+
## Unreleased
4+
5+
### Added
6+
7+
- initial support for JetBrains Toolbox 2.6.0.38311 with the possibility to manage the workspaces - i.e. start, stop,
8+
update and delete actions and also quick shortcuts to templates, web terminal and dashboard.

0 commit comments

Comments
 (0)