1- name : Publish to JetBrains Marketplace
1+ name : Plugin deployment
22
33on :
4- push :
4+ pull_request :
55
66concurrency :
77 group : publish-plugin-${{ github.ref_name }}
88 cancel-in-progress : true
99
10-
1110jobs :
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 :
@@ -20,73 +19,46 @@ jobs:
2019 - 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 Coretto 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- - 252
50- - 253
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
5639
57- - uses : actions/setup-java@v4
40+ - name : Build plugin
41+ run : ./gradlew buildPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
42+
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+ continue-on-error : true
52+ run : ./gradlew test -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
7153
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'
87- #
88- # - name: Publish Plugin
89- # run: |
90- # ./gradlew publishPlugin --no-daemon
91- # env:
92- # JB_MARKETPLACE_TOKEN: ${{ secrets.JB_MARKETPLACE_TOKEN }}
54+ - name : Verify plugin
55+ run : ./gradlew verifyPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
56+
57+ - name : Upload plugin to Marketplace
58+ if : github.ref == 'refs/heads/main' &&
59+ github.event_name == 'push' &&
60+ steps.run-tests.outcome == 'success'
61+ continue-on-error : true
62+ run : ./gradlew publishPlugin -PenvironmentName=${{ matrix.environmentName }} -PpluginVersion=${{ env.VERSION }}
63+ env :
64+ JB_MARKETPLACE_TOKEN : ${{ secrets.JB_MARKETPLACE_TOKEN }}
0 commit comments