-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies * Rename .yml to .yaml * Sync workflows with template * Update changelog and version
- Loading branch information
Showing
11 changed files
with
171 additions
and
68 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Checkout intellij-community | ||
description: Checkout intellij-community repository with the correct tag | ||
|
||
inputs: | ||
path: | ||
description: Path where to checkout the repository | ||
default: intellij-community | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# TODO: Fetch version number for regex from gradle properties | ||
- name: Find latest tag for given IntelliJ version | ||
uses: oprypin/[email protected] | ||
id: intellij-tag | ||
with: | ||
repository: JetBrains/intellij-community | ||
regex: ^idea\/222\.4554(?:\.\d+)?$ | ||
|
||
- name: Checkout intellij-community repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
repository: JetBrains/intellij-community | ||
ref: ${{ steps.intellij-tag.outputs.tag }} | ||
path: ${{ inputs.path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,91 +24,161 @@ jobs: | |
outputs: | ||
version: ${{ steps.properties.outputs.version }} | ||
changelog: ${{ steps.properties.outputs.changelog }} | ||
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }} | ||
steps: | ||
|
||
# Free GitHub Actions Environment Disk Space | ||
- name: Maximize Build Space | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /usr/local/lib/android | ||
sudo rm -rf /opt/ghc | ||
# Check out current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
# Validate wrapper | ||
- name: Gradle Wrapper Validation | ||
uses: gradle/[email protected] | ||
|
||
# TODO: Fetch version number for regex from gradle properties | ||
- name: Find latest tag for given IntelliJ version | ||
uses: oprypin/[email protected] | ||
id: intellij-tag | ||
with: | ||
repository: JetBrains/intellij-community | ||
regex: ^idea\/222\.4554(?:\.\d+)?$ | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Checkout intellij-community repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
repository: JetBrains/intellij-community | ||
ref: ${{ steps.intellij-tag.outputs.tag }} | ||
path: intellij-community | ||
- name: Fetch intellij-community | ||
uses: ./.github/actions/checkout-intellij-community | ||
|
||
- name: Setup Java environment for the next steps | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Set environment variables | ||
- name: Export Properties | ||
id: properties | ||
run: | | ||
PROPERTIES="$(./gradlew properties --console=plain -q)" | ||
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" | ||
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" | ||
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
echo "name=$NAME" >> $GITHUB_OUTPUT | ||
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT | ||
echo "changelog<<EOF" >> $GITHUB_OUTPUT | ||
echo "$CHANGELOG" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier | ||
- name: Run tests | ||
# Build plugin | ||
- name: Build plugin | ||
run: ./gradlew buildPlugin | ||
|
||
# Prepare plugin archive content for creating artifact | ||
- name: Prepare Plugin Artifact | ||
id: artifact | ||
run: | | ||
cd ${{ github.workspace }}/build/distributions | ||
FILENAME=`ls *.zip` | ||
unzip "$FILENAME" -d content | ||
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT | ||
# Store already-built plugin as an artifact for downloading | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.artifact.outputs.filename }} | ||
path: ./build/distributions/content/*/* | ||
|
||
# Run tests and upload a code coverage report | ||
test: | ||
name: Test | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Check out current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch intellij-community | ||
uses: ./.github/actions/checkout-intellij-community | ||
|
||
# Set up Java environment for the next steps | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Run tests | ||
- name: Run Tests | ||
run: ./gradlew check | ||
|
||
- name: Collect test results of failed tests | ||
# Collect Tests Result of failed tests | ||
- name: Collect Tests Result | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tests-result | ||
path: ${{ github.workspace }}/build/reports/tests | ||
|
||
- name: Add coverage report to PR | ||
uses: mi-kas/kover-report@v1.6 | ||
uses: mi-kas/kover-report@v1.7 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
path: ${{ github.workspace }}/build/reports/kover/report.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: Code Coverage | ||
update-comment: true | ||
|
||
# Run plugin structure verification along with IntelliJ Plugin Verifier | ||
verify: | ||
name: Verify plugin | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Free GitHub Actions Environment Disk Space | ||
- name: Maximize Build Space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
large-packages: false | ||
|
||
# Check out current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch intellij-community | ||
uses: ./.github/actions/checkout-intellij-community | ||
|
||
# Set up Java environment for the next steps | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Cache Plugin Verifier IDEs | ||
- name: Setup Plugin Verifier IDEs Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides | ||
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides | ||
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} | ||
|
||
# Run Verify Plugin task and IntelliJ Plugin Verifier tool | ||
- name: Run Plugin Verification tasks | ||
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} | ||
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }} | ||
|
||
# Collect Plugin Verifier Result | ||
- name: Collect Plugin Verifier Result | ||
|
@@ -118,36 +188,20 @@ jobs: | |
name: pluginVerifier-result | ||
path: ${{ github.workspace }}/build/reports/pluginVerifier | ||
|
||
# Prepare plugin archive content for creating artifact | ||
- name: Prepare Plugin Artifact | ||
id: artifact | ||
working-directory: ${{ github.workspace }}/build/distributions | ||
run: | | ||
FILENAME=`ls *.zip` | ||
unzip "$FILENAME" -d content | ||
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT | ||
# Store already-built plugin as an artifact for downloading | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ steps.artifact.outputs.filename }} | ||
path: ./build/distributions/content/*/* | ||
|
||
# Prepare a draft release for GitHub Releases page for manual verification | ||
# If accepted and published, release workflow would be triggered | ||
release_draft: | ||
name: Release Draft | ||
name: Release draft | ||
if: github.event_name != 'pull_request' | ||
needs: build | ||
needs: [build, test, verify] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
|
||
# Check out current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
# Remove old release drafts by using the curl request for the available releases with a draft flag | ||
- name: Remove Old Release Drafts | ||
|
@@ -157,6 +211,7 @@ jobs: | |
gh api repos/{owner}/{repo}/releases \ | ||
--jq '.[] | select(.draft == true) | .id' \ | ||
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} | ||
# Create a new release draft which is not publicly visible and requires manual acceptance | ||
- name: Create Release Draft | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ defaults: | |
shell: bash | ||
|
||
jobs: | ||
# Prepare and publish the plugin to the Marketplace repository | ||
# Prepare and publish the plugin to JetBrains Marketplace repository | ||
release: | ||
name: Publish plugin | ||
runs-on: ubuntu-latest | ||
|
@@ -19,16 +19,23 @@ jobs: | |
|
||
# Check out current repository | ||
- name: Fetch Sources | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
|
||
# Set up Java environment for the next steps | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
# Setup Gradle | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Set environment variables | ||
- name: Export Properties | ||
id: properties | ||
|
@@ -50,7 +57,7 @@ jobs: | |
run: | | ||
./gradlew patchChangelog --release-note="$CHANGELOG" | ||
# Publish the plugin to the Marketplace | ||
# Publish the plugin to JetBrains Marketplace | ||
- name: Publish Plugin | ||
env: | ||
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | ||
|
@@ -65,23 +72,30 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* | ||
|
||
# Create pull request | ||
# Create a pull request | ||
- name: Create Pull Request | ||
if: ${{ steps.properties.outputs.changelog != '' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
VERSION="${{ github.event.release.tag_name }}" | ||
BRANCH="changelog-update-$VERSION" | ||
LABEL="release changelog" | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Action" | ||
git checkout -b $BRANCH | ||
git commit -am "Changelog update - $VERSION" | ||
git push --set-upstream origin $BRANCH | ||
gh label create "$LABEL" \ | ||
--description "Pull requests with release changelog update" \ | ||
--force \ | ||
|| true | ||
gh pr create \ | ||
--title "Changelog update - \`$VERSION\`" \ | ||
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \ | ||
--label "$LABEL" \ | ||
--head $BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.