Skip to content

Commit 0e21551

Browse files
authored
ALT-10990 plugin build publishing script
1 parent 3428c12 commit 0e21551

2 files changed

Lines changed: 31 additions & 61 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 29 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,61 @@
1-
name: Publish to JetBrains Marketplace
1+
name: Plugin deployment
22

33
on:
4-
push:
4+
pull_request:
55

66
concurrency:
77
group: publish-plugin-${{ github.ref_name }}
88
cancel-in-progress: true
99

10-
1110
jobs:
12-
test:
13-
name: Run Tests for ${{ matrix.environmentName }}
11+
deploy:
12+
name: Deploy the plugin for ${{ matrix.environmentName }}
1413
runs-on: arc-runners-large
1514
timeout-minutes: 60
1615
strategy:
1716
matrix:
1817
environmentName:
19-
- 251
2018
- 252
19+
- 253
2120
fail-fast: false
2221
steps:
23-
- uses: actions/checkout@v4
22+
- name: Checkout code
23+
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 1
2626

27-
- uses: actions/setup-java@v4
27+
- name: Setup Corretto JDK
28+
uses: actions/setup-java@v4
2829
with:
2930
java-version-file: '.java-version'
3031
distribution: 'corretto'
3132
cache: 'gradle'
3233

33-
- name: Run Tests
34-
env:
35-
GRADLE_OPTS: "-Xmx2g -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options=-Xmx1g"
36-
run: |
37-
echo "environmentName=${{ matrix.environmentName }}"
38-
./gradlew test \
39-
--parallel -Dorg.gradle.workers.max=2 -Dorg.gradle.test.worker.max=2 \
40-
--no-daemon -PenvironmentName=${{ matrix.environmentName }}
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v3
4136

42-
verify:
43-
name: Verify Plugin for ${{ matrix.environmentName }}
44-
runs-on: arc-runners-large
45-
timeout-minutes: 60
46-
strategy:
47-
matrix:
48-
environmentName:
49-
- 251
50-
- 252
51-
fail-fast: false
52-
steps:
53-
- uses: actions/checkout@v4
54-
with:
55-
fetch-depth: 1
37+
- name: Generate timestamp
38+
run: echo "VERSION=$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_ENV
39+
40+
- name: Build plugin
41+
run: ./gradlew buildPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
5642

57-
- uses: actions/setup-java@v4
43+
- name: Upload plugin to PR
44+
uses: actions/upload-artifact@v4
5845
with:
59-
java-version-file: '.java-version'
60-
distribution: 'corretto'
61-
cache: 'gradle'
46+
name: HyperskillAcademy-${{ env.VERSION }}-${{ matrix.environmentName }}
47+
path: intellij-plugin/build/distributions
48+
retention-days: 3
6249

63-
- name: Verify Plugin
64-
env:
65-
GRADLE_OPTS: "-Xmx2g -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options=-Xmx1g"
66-
run: |
67-
echo "environmentName=${{ matrix.environmentName }}"
68-
./gradlew verifyPlugin \
69-
--parallel -Dorg.gradle.workers.max=2 -Dorg.gradle.test.worker.max=2 \
70-
--no-daemon -PenvironmentName=${{ matrix.environmentName }}
50+
- name: Run tests
51+
run: ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
7152

72-
# publish:
73-
# name: Publish Plugin
74-
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
75-
# runs-on: arc-runners-large
76-
# needs:
77-
# - test
78-
# - verify
79-
# timeout-minutes: 30
80-
# steps:
81-
# - uses: actions/checkout@v4
82-
#
83-
# - uses: actions/setup-java@v4
84-
# with:
85-
# java-version-file: '.java-version'
86-
# distribution: 'corretto'
53+
- name: Verify plugin
54+
run: ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
8755
#
88-
# - name: Publish Plugin
89-
# run: |
90-
# ./gradlew publishPlugin --no-daemon
56+
# - name: Upload plugin to Marketplace
57+
# if: github.ref == 'refs/heads/main' &&
58+
# github.event_name == 'push' &&
59+
# run: ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
9160
# env:
9261
# JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ enableBuildSearchableOptions=false
2828
# Note, remove `-` before build number (`b` letter) to make it work
2929
#jbrVersion=17.0.11b1207.24
3030

31-
org.gradle.jvmargs=-Xmx2g
31+
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m
32+
kotlin.daemon.jvm.options=-Xmx1g
3233

3334
# Since kotlin 1.4, stdlib dependency is added by default by kotlin gradle plugin.
3435
# But we don't need it because all necessary kotlin libraries are already bundled into IDE.

0 commit comments

Comments
 (0)