1010#
1111# GitHub Actions reference: https://help.github.com/en/actions
1212#
13- # # JBIJPPTPL
13+ # # JBIJPPTPL (Jetbrains intellij platform plugin template)
1414
1515name : Build
1616on :
1717 # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
1818 push :
19- # branches: [main]
20- # todo: temp, should be main
21- branches : [ publish-workflow ]
19+ branches : [ main ]
2220 # Trigger the workflow on any pull request
23- # pull_request:
24-
21+ pull_request :
22+ branches : [ main ]
2523
2624jobs :
2725
26+ # todo: java matrix , os matrix
27+
2828 # Run Gradle Wrapper Validation Action to verify the wrapper's checksum
2929 # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
3030 # Build plugin and provide the artifact for the next workflow jobs
3434 outputs :
3535 version : ${{ steps.properties.outputs.version }}
3636 changelog : ${{ steps.properties.outputs.changelog }}
37+
3738 steps :
3839
3940 # Check out current repository
4849 - name : Setup Java
4950 uses : actions/setup-java@v3
5051 with :
51- distribution : zulu
52- java-version : 11
53- cache : gradle
52+ java-version : ' 11'
53+ distribution : ' corretto'
54+
55+ # All subsequent Gradle invocations will benefit from caching, build-scan capture and other features of the gradle-build-action.
56+ # setup-java can also cache gradle, but we use gradle-build-action for gradle caching and should not mix between workflows.
57+ - name : Setup Gradle
58+ 5459
5560 # Set environment variables
5661 - name : Export Properties
@@ -60,24 +65,27 @@ jobs:
6065 PROPERTIES="$(./gradlew properties --console=plain -q)"
6166 VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
6267 NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
63- CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
64- CHANGELOG="${CHANGELOG//'%'/'%25'}"
65- CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
66- CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
67-
68+
69+ # the original template feeds the whole changelog history to the release draft. we don't need it,
70+ # and we don't keep a changelog file in the repository
71+ # CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
72+ # CHANGELOG="${CHANGELOG//'%'/'%25'}"
73+ # CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
74+ # CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
75+
6876 echo "::set-output name=version::$VERSION"
6977 echo "::set-output name=name::$NAME"
70- echo "::set-output name=changelog::$CHANGELOG"
78+ # echo "::set-output name=changelog::$CHANGELOG"
7179 echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
72-
80+
7381 ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
7482
7583 # Run tests
7684 - name : Run Tests
7785 run : ./gradlew test
7886
7987 # Collect Tests Result of failed tests
80- # #todo: add more modules reports
88+ # #todo: add other modules test reports
8189 - name : Collect Tests Result
8290 if : ${{ failure() }}
8391 uses : actions/upload-artifact@v3
94102
95103 # Run Verify Plugin task and IntelliJ Plugin Verifier tool
96104 - name : Run Plugin Verification tasks
97- run : ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
105+ run : ./gradlew buildPlugin runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
98106
99107 # Collect Plugin Verifier Result
100108 - name : Collect Plugin Verifier Result
@@ -157,7 +165,8 @@ jobs:
157165 gh release create v${{ needs.build.outputs.version }} \
158166 --draft \
159167 --title "v${{ needs.build.outputs.version }}" \
160- --notes "$(cat << 'EOM'
161- ${{ needs.build.outputs.changelog }}
162- EOM
163- )"
168+ --notes "## $VERSION ATX_2 is reserved for patchChangelog"
169+ # --notes "$(cat << 'EOM'
170+ # ${{ needs.build.outputs.changelog }}
171+ # EOM
172+ # )"
0 commit comments