Skip to content
Merged
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
34 changes: 23 additions & 11 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Plugin deployment

on:
push:
branches: [ main ]
pull_request:
release:
types: [ published ]

concurrency:
group: publish-plugin-${{ github.ref_name }}
Expand Down Expand Up @@ -30,18 +34,19 @@ jobs:
with:
java-version-file: '.java-version'
distribution: 'corretto'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Generate timestamp
run: echo "VERSION=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_ENV
- name: Resolve plugin version
run: |
BASE_VERSION=$(grep '^pluginVersion=' gradle.properties | cut -d'=' -f2)
echo "VERSION=${BASE_VERSION}.${{ github.run_number }}" >> $GITHUB_ENV

- name: Build plugin
run: ./gradlew buildPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}

- name: Upload plugin to PR
- name: Upload plugin artifact
uses: actions/upload-artifact@v4
with:
name: HyperskillAcademy-${{ env.VERSION }}-${{ matrix.environmentName }}
Expand All @@ -53,10 +58,17 @@ jobs:

- name: Verify plugin
run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
#
# - name: Upload plugin to Marketplace
# if: github.ref == 'refs/heads/main' &&
# github.event_name == 'push' &&
# run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
# env:
# JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}

- name: Publish plugin to Marketplace (dev channel)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
env:
JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}
JB_MARKETPLACE_CHANNEL: dev

- name: Publish plugin to Marketplace (stable channel)
if: github.event_name == 'release'
run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
env:
JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}
JB_MARKETPLACE_CHANNEL: ""
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 6 additions & 0 deletions intellij-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ intellijPlatform {
}
}

publishing {
token = providers.environmentVariable("JB_MARKETPLACE_TOKEN")
channels = listOf(providers.environmentVariable("JB_MARKETPLACE_CHANNEL").getOrElse("dev"))
hidden = false
}

// Enable IDE caching for plugin verification
// Cache path is configured via org.jetbrains.intellij.platform.intellijPlatformCache in gradle.properties
caching {
Expand Down
Loading