Skip to content

Commit

Permalink
intellij: pull template
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Aug 11, 2024
1 parent 8be017f commit e7761a1
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ on:
paths:
- "intellij/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

# Prepare environment and build the plugin
Expand All @@ -34,13 +38,13 @@ jobs:
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation[email protected]
uses: gradle/actions/wrapper-validation@v3

# Set up Java environment for the next steps
- name: Setup Java
Expand All @@ -51,7 +55,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -72,8 +76,6 @@ jobs:
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
# Build plugin
- name: Build plugin
working-directory: ./intellij
Expand All @@ -92,7 +94,7 @@ jobs:
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./intellij/build/distributions/content/*/*
Expand All @@ -104,7 +106,7 @@ jobs:
runs-on: ubuntu-latest
steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

Expand All @@ -117,7 +119,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -129,14 +131,14 @@ jobs:
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/intellij/build/reports/tests

# Upload the Kover report to CodeCov
- name: Upload Code Coverage Report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/intellij/build/reports/kover/report.xml

Expand All @@ -158,7 +160,7 @@ jobs:
tool-cache: false
large-packages: false

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

Expand All @@ -169,6 +171,11 @@ jobs:
distribution: zulu
java-version: 17

# Run Qodana inspections
# - name: Qodana - Code Inspection
# uses: JetBrains/[email protected]
# with:
# cache-default-branch-only: true

# Run plugin structure verification along with IntelliJ Plugin Verifier
verify:
Expand All @@ -184,7 +191,7 @@ jobs:
tool-cache: false
large-packages: false

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

Expand All @@ -197,26 +204,26 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('intellij/build/listProductsReleases.txt') }}

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
working-directory: ./intellij
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/intellij/build/reports/pluginVerifier
Expand All @@ -232,17 +239,10 @@ jobs:
# contents: write
# steps:
#
# # Check out current repository
# # Check out the current repository
# - name: Fetch Sources
# uses: actions/checkout@v4
#
# # Set up Java environment for the next steps
# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: zulu
# java-version: 17
#
# # Remove old release drafts by using the curl request for the available releases with a draft flag
# - name: Remove Old Release Drafts
# env:
Expand All @@ -257,7 +257,7 @@ jobs:
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# gh release create v${{ needs.build.outputs.version }} \
# gh release create "v${{ needs.build.outputs.version }}" \
# --draft \
# --title "v${{ needs.build.outputs.version }}" \
# --notes "$(cat << 'EOM'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
pull-requests: write
steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
with:
Expand All @@ -34,7 +34,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -52,8 +52,9 @@ jobs:
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Update Unreleased section with the current release note
# Update the Unreleased section with the current release note
- name: Patch Changelog
working-directory: ./intellij
if: ${{ steps.properties.outputs.changelog != '' }}
env:
CHANGELOG: ${{ steps.properties.outputs.changelog }}
Expand All @@ -62,6 +63,7 @@ jobs:
# Publish the plugin to JetBrains Marketplace
- name: Publish Plugin
working-directory: ./intellij
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
Expand All @@ -73,32 +75,32 @@ jobs:
- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
run: gh release upload ${{ github.event.release.tag_name }} ./intellij/build/distributions/*

# 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
# - 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:

# Check out current repository
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

Expand All @@ -44,7 +44,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

Expand All @@ -54,7 +54,7 @@ jobs:

# Wait for IDEA to be started
- name: Health Check
uses: jtalk/url-health-check-action@v3
uses: jtalk/url-health-check-action@v4
with:
url: http://127.0.0.1:8082
max-attempts: 15
Expand Down
5 changes: 5 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions intellij/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
.idea
.intellijPlatform
.qodana
build
25 changes: 0 additions & 25 deletions intellij/.run/Run IDE for UI Tests.run.xml

This file was deleted.

30 changes: 0 additions & 30 deletions intellij/.run/Run Qodana.run.xml

This file was deleted.

1 change: 1 addition & 0 deletions intellij/.run/Run Tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
</component>
Loading

0 comments on commit e7761a1

Please sign in to comment.