Skip to content

Commit e1e04d9

Browse files
committed
Initial commit. @ChrisCarini; Semi-working, but not showing anything useful. See notes for list-o-links.
0 parents  commit e1e04d9

18 files changed

+1089
-0
lines changed

.github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
schedule:
10+
interval: "daily"
11+
12+
# Maintain dependencies for GitHub Actions
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "daily"
17+
labels:
18+
- "merge when passing" # This is a label that [Repo Ranger](https://github.com/apps/repo-ranger) will pickup and auto-merge when all GH checks pass.

.github/workflows/build.yml

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
2+
# - validate Gradle Wrapper,
3+
# - run test and verifyPlugin tasks,
4+
# - run buildPlugin task and prepare artifact for the further tests,
5+
# - run IntelliJ Plugin Verifier,
6+
# - create a draft release.
7+
#
8+
# Workflow is triggered on push and pull_request events.
9+
#
10+
# Docs:
11+
# - GitHub Actions: https://help.github.com/en/actions
12+
# - IntelliJ Plugin Verifier GitHub Action: https://github.com/ChrisCarini/intellij-platform-plugin-verifier-action
13+
#
14+
15+
name: Build
16+
on:
17+
# Trigger the workflow on pushes to only the 'master' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
18+
push:
19+
branches: [ master ]
20+
21+
# Trigger the workflow on any pull request
22+
pull_request:
23+
24+
jobs:
25+
26+
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
27+
gradleValidation:
28+
name: Gradle Wrapper
29+
runs-on: ubuntu-latest
30+
steps:
31+
32+
# Check out current repository
33+
- name: Fetch Sources
34+
uses: actions/[email protected]
35+
36+
# Validate wrapper
37+
- name: Gradle Wrapper Validation
38+
uses: gradle/[email protected]
39+
40+
# Run verifyPlugin and test Gradle tasks
41+
test:
42+
name: Test
43+
needs: gradleValidation
44+
runs-on: ubuntu-latest
45+
steps:
46+
47+
# Check out current repository
48+
- name: Fetch Sources
49+
uses: actions/[email protected]
50+
51+
# Setup Java 11 environment for the next steps
52+
- name: Setup Java
53+
uses: actions/setup-java@v2
54+
with:
55+
distribution: zulu
56+
java-version: 11
57+
cache: gradle
58+
59+
# Set environment variables
60+
- name: Export Properties
61+
id: properties
62+
shell: bash
63+
run: |
64+
PROPERTIES="$(./gradlew properties --console=plain -q)"
65+
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
66+
67+
echo "::set-output name=ideVersions::$IDE_VERSIONS"
68+
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
69+
70+
# Cache Plugin Verifier IDEs
71+
- name: Setup Plugin Verifier IDEs Cache
72+
uses: actions/[email protected]
73+
with:
74+
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
75+
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
76+
77+
# ## TODO (ChrisCarini) - Disabling this in the GH action; when running we see the below error message:
78+
# ## STDERR: Could not read script '/data/project/jetbrainsCredentials.gradle' as it does not exist
79+
# # Run Qodana inspections
80+
# - name: Qodana - Code Inspection
81+
# uses: JetBrains/[email protected]
82+
83+
# Run tests
84+
- name: Run Tests
85+
run: ./gradlew test
86+
87+
# Run verifyPlugin Gradle task
88+
- name: Verify Plugin
89+
run: ./gradlew verifyPlugin
90+
91+
# Run IntelliJ Plugin Verifier action using GitHub Action
92+
- name: Run Plugin Verifier
93+
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
94+
95+
# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
96+
# Requires test job to be passed
97+
build:
98+
name: Build
99+
needs: test
100+
runs-on: ubuntu-latest
101+
outputs:
102+
version: ${{ steps.properties.outputs.version }}
103+
changelog: ${{ steps.properties.outputs.changelog }}
104+
steps:
105+
106+
# Check out current repository
107+
- name: Fetch Sources
108+
uses: actions/[email protected]
109+
110+
# Setup Java 11 environment for the next steps
111+
- name: Setup Java
112+
uses: actions/setup-java@v2
113+
with:
114+
distribution: zulu
115+
java-version: 11
116+
cache: gradle
117+
118+
# Set environment variables
119+
- name: Export Properties
120+
id: properties
121+
shell: bash
122+
run: |
123+
PROPERTIES="$(./gradlew properties --console=plain -q)"
124+
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
125+
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
126+
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
127+
CHANGELOG="${CHANGELOG//'%'/'%25'}"
128+
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
129+
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
130+
131+
echo "::set-output name=version::$VERSION"
132+
echo "::set-output name=name::$NAME"
133+
echo "::set-output name=changelog::$CHANGELOG"
134+
135+
# Build artifact using buildPlugin Gradle task
136+
- name: Build Plugin
137+
run: ./gradlew buildPlugin
138+
139+
# Store built plugin as an artifact for downloading
140+
- name: Upload artifacts
141+
uses: actions/[email protected]
142+
with:
143+
name: "${{ steps.properties.outputs.name }} - ${{ steps.properties.outputs.version }}"
144+
path: ./build/distributions/*
145+
146+
# Prepare a draft release for GitHub Releases page for the manual verification
147+
# If accepted and published, release workflow would be triggered
148+
releaseDraft:
149+
name: Release Draft
150+
if: github.event_name != 'pull_request'
151+
needs: build
152+
runs-on: ubuntu-latest
153+
steps:
154+
155+
# Check out current repository
156+
- name: Fetch Sources
157+
uses: actions/[email protected]
158+
159+
# Remove old release drafts by using the curl request for the available releases with draft flag
160+
- name: Remove Old Release Drafts
161+
env:
162+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
run: |
164+
gh api repos/{owner}/{repo}/releases \
165+
--jq '.[] | select(.draft == true) | .id' \
166+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
167+
168+
# Create new release draft - which is not publicly visible and requires manual acceptance
169+
- name: Create Release Draft
170+
env:
171+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172+
run: |
173+
gh release create v${{ needs.build.outputs.version }} \
174+
--draft \
175+
--title "v${{ needs.build.outputs.version }}" \
176+
--notes "${{ needs.build.outputs.changelog }}"

.github/workflows/compatibility.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: IntelliJ Plugin Compatibility
2+
3+
on:
4+
# Trigger the workflow on pushes to only the 'master' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
5+
push:
6+
branches: [ master ]
7+
8+
# Trigger the workflow on any pull request
9+
pull_request:
10+
11+
# Trigger the workflow on a schedule; daily
12+
schedule:
13+
- cron: '0 0 * * *'
14+
15+
jobs:
16+
compatibility:
17+
name: Ensure plugin compatibility against targeted platform version & the latest EAP snapshot for both IDEA Community, IDEA Ultimate.
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Check out repository
23+
uses: actions/[email protected]
24+
25+
- name: Setup Java 11
26+
uses: actions/setup-java@v2
27+
with:
28+
java-version: 11
29+
distribution: 'zulu'
30+
31+
- name: Build the plugin
32+
run: ./gradlew buildPlugin
33+
34+
- name: Verify plugin on IntelliJ Platforms
35+
id: verify
36+
uses: ChrisCarini/intellij-platform-plugin-verifier-action@latest
37+
with:
38+
ide-versions: |
39+
ideaIC:2021.3
40+
ideaIU:2021.3
41+
ideaIC:LATEST-EAP-SNAPSHOT
42+
ideaIU:LATEST-EAP-SNAPSHOT
43+
44+
- name: Get log file path and print contents
45+
run: |
46+
echo "The log file path is: ${{steps.verify.outputs.verification-output-log-filename}}" ;
47+
cat ${{steps.verify.outputs.verification-output-log-filename}}

.github/workflows/release.yml

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

.gitignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*.iml
2+
*.ipr
3+
*.iws
4+
.gradle/
5+
.qodana/
6+
build/
7+
gradle/
8+
out/
9+
gradlew*
10+
jetbrainsCredentials.gradle
11+
private.pem
12+
chain.crt
13+
*.DS_Store

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Keep a Changelog guide -> https://keepachangelog.com -->
2+
3+
# IntelliJ Platform Plugin Template Changelog
4+
5+
## [Unreleased]
6+
7+
### Added
8+
9+
### Changed
10+
11+
### Deprecated
12+
13+
### Removed
14+
15+
### Fixed
16+
17+
### Security
18+
19+
## [0.0.1] - 2022-01-02
20+
21+
### Added
22+
23+
- Initial Revision. Laying the foundation. It doesn't do much useful right now; this is not a released version, but
24+
might be one day.

0 commit comments

Comments
 (0)