|
12 | 12 | #
|
13 | 13 | ## JBIJPPTPL
|
14 | 14 |
|
15 |
| -name: Build |
16 |
| -on: |
| 15 | +name : Build |
| 16 | +on : |
17 | 17 | # Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
|
18 |
| - push: |
19 |
| - branches: [main] |
| 18 | + push : |
| 19 | + branches : [ main ] |
20 | 20 | # Trigger the workflow on any pull request
|
21 |
| - pull_request: |
| 21 | + pull_request : |
22 | 22 |
|
23 |
| -jobs: |
| 23 | +jobs : |
24 | 24 |
|
25 | 25 | # Run Gradle Wrapper Validation Action to verify the wrapper's checksum
|
26 | 26 | # Run verifyPlugin, IntelliJ Plugin Verifier, and test Gradle tasks
|
27 | 27 | # Build plugin and provide the artifact for the next workflow jobs
|
28 |
| - build: |
29 |
| - name: Build |
30 |
| - runs-on: ubuntu-latest |
31 |
| - outputs: |
32 |
| - version: ${{ steps.properties.outputs.version }} |
33 |
| - changelog: ${{ steps.properties.outputs.changelog }} |
34 |
| - steps: |
| 28 | + build : |
| 29 | + name : Build |
| 30 | + runs-on : ubuntu-latest |
| 31 | + outputs : |
| 32 | + version : ${{ steps.properties.outputs.version }} |
| 33 | + changelog : ${{ steps.properties.outputs.changelog }} |
| 34 | + steps : |
35 | 35 |
|
36 | 36 | # Free GitHub Actions Environment Disk Space
|
37 |
| - - name: Maximize Build Space |
38 |
| - run: | |
| 37 | + - name : Maximize Build Space |
| 38 | + run : | |
39 | 39 | sudo rm -rf /usr/share/dotnet
|
40 | 40 | sudo rm -rf /usr/local/lib/android
|
41 | 41 | sudo rm -rf /opt/ghc
|
42 | 42 |
|
43 | 43 | # Check out current repository
|
44 |
| - - name: Fetch Sources |
45 |
| - uses: actions/checkout@v3.3.0 |
| 44 | + - name : Fetch Sources |
| 45 | + uses : actions/checkout@v3 |
46 | 46 |
|
47 | 47 | # Validate wrapper
|
48 |
| - - name: Gradle Wrapper Validation |
49 |
| - uses: gradle/wrapper-validation-action@v1.0.6 |
| 48 | + - name : Gradle Wrapper Validation |
| 49 | + uses : gradle/wrapper-validation-action@v1.0.6 |
50 | 50 |
|
51 | 51 | # Setup Java 11 environment for the next steps
|
52 |
| - - name: Setup Java |
53 |
| - uses: actions/setup-java@v3 |
54 |
| - with: |
55 |
| - distribution: zulu |
56 |
| - java-version: 11 |
| 52 | + - name : Setup Java |
| 53 | + uses : actions/setup-java@v3 |
| 54 | + with : |
| 55 | + distribution : zulu |
| 56 | + java-version : 11 |
57 | 57 |
|
58 | 58 | # Set environment variables
|
59 |
| - - name: Export Properties |
60 |
| - id: properties |
61 |
| - shell: bash |
62 |
| - run: | |
| 59 | + - name : Export Properties |
| 60 | + id : properties |
| 61 | + shell : bash |
| 62 | + run : | |
63 | 63 | PROPERTIES="$(./gradlew properties --console=plain -q)"
|
64 | 64 | VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
|
65 | 65 | NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
|
66 | 66 | CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
|
67 |
| - CHANGELOG="${CHANGELOG//'%'/'%25'}" |
68 |
| - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" |
69 |
| - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" |
70 | 67 |
|
71 |
| - echo "::set-output name=version::$VERSION" |
72 |
| - echo "::set-output name=name::$NAME" |
73 |
| - echo "::set-output name=changelog::$CHANGELOG" |
74 |
| - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" |
| 68 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 69 | + echo "name=$NAME" >> $GITHUB_OUTPUT |
| 70 | + echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT |
| 71 | + |
| 72 | + echo "changelog<<EOF" >> $GITHUB_OUTPUT |
| 73 | + echo "$CHANGELOG" >> $GITHUB_OUTPUT |
| 74 | + echo "EOF" >> $GITHUB_OUTPUT |
75 | 75 |
|
76 | 76 | ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
|
77 | 77 |
|
78 |
| - # Run tests |
79 |
| -# - name: Run Tests |
80 |
| -# run: ./gradlew check |
81 |
| - |
82 |
| - # Collect Tests Result of failed tests |
83 |
| -# - name: Collect Tests Result |
84 |
| -# if: ${{ failure() }} |
85 |
| -# uses: actions/upload-artifact@v3 |
86 |
| -# with: |
87 |
| -# name: tests-result |
88 |
| -# path: ${{ github.workspace }}/build/reports/tests |
89 |
| - |
90 |
| - # Upload Kover report to CodeCov |
91 |
| -# - name: Upload Code Coverage Report |
92 |
| -# uses: codecov/codecov-action@v3 |
93 |
| -# with: |
94 |
| -# files: ${{ github.workspace }}/build/reports/kover/xml/report.xml |
95 |
| -# fail_ci_if_error: false |
| 78 | + # # Run tests |
| 79 | + # - name: Run Tests |
| 80 | + # run: ./gradlew check |
| 81 | + # |
| 82 | + # # Collect Tests Result of failed tests |
| 83 | + # - name: Collect Tests Result |
| 84 | + # if: ${{ failure() }} |
| 85 | + # uses: actions/upload-artifact@v3 |
| 86 | + # with: |
| 87 | + # name: tests-result |
| 88 | + # path: ${{ github.workspace }}/build/reports/tests |
| 89 | + # |
| 90 | + # # Upload Kover report to CodeCov |
| 91 | + # - name: Upload Code Coverage Report |
| 92 | + # uses: codecov/codecov-action@v3 |
| 93 | + # with: |
| 94 | + # files: ${{ github.workspace }}/build/reports/kover/xml/report.xml |
96 | 95 |
|
97 | 96 | # Cache Plugin Verifier IDEs
|
98 |
| - - name: Setup Plugin Verifier IDEs Cache |
99 |
| - uses: actions/cache@v3 |
100 |
| - with: |
101 |
| - path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides |
102 |
| - key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} |
| 97 | + - name : Setup Plugin Verifier IDEs Cache |
| 98 | + uses : actions/cache@v3 |
| 99 | + with : |
| 100 | + path : ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides |
| 101 | + key : plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} |
103 | 102 |
|
104 | 103 | # Run Verify Plugin task and IntelliJ Plugin Verifier tool
|
105 |
| - - name: Run Plugin Verification tasks |
106 |
| - run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} |
| 104 | + - name : Run Plugin Verification tasks |
| 105 | + run : ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} |
107 | 106 |
|
108 | 107 | # Collect Plugin Verifier Result
|
109 |
| - - name: Collect Plugin Verifier Result |
110 |
| - if: ${{ always() }} |
111 |
| - uses: actions/upload-artifact@v3 |
112 |
| - with: |
113 |
| - name: pluginVerifier-result |
114 |
| - path: ${{ github.workspace }}/build/reports/pluginVerifier |
| 108 | + - name : Collect Plugin Verifier Result |
| 109 | + if : ${{ always() }} |
| 110 | + uses : actions/upload-artifact@v3 |
| 111 | + with : |
| 112 | + name : pluginVerifier-result |
| 113 | + path : ${{ github.workspace }}/build/reports/pluginVerifier |
115 | 114 |
|
116 | 115 | # Run Qodana inspections
|
117 |
| - - name: Qodana - Code Inspection |
118 |
| - uses: JetBrains/qodana-action@main |
119 |
| - env: |
120 |
| - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} |
121 |
| - |
122 |
| - # Add Quodona report to Github Codescanning |
123 |
| - - uses : github/codeql-action/upload-sarif@v2 |
124 |
| - with : |
125 |
| - sarif_file : ${{ runner.temp }}/qodana/results/qodana.sarif.json |
| 116 | + - name : Qodana - Code Inspection |
| 117 | + uses : JetBrains/qodana-action@v2022.3.4 |
126 | 118 |
|
127 | 119 | # Prepare plugin archive content for creating artifact
|
128 |
| - - name: Prepare Plugin Artifact |
129 |
| - id: artifact |
130 |
| - shell: bash |
131 |
| - run: | |
| 120 | + - name : Prepare Plugin Artifact |
| 121 | + id : artifact |
| 122 | + shell : bash |
| 123 | + run : | |
132 | 124 | cd ${{ github.workspace }}/build/distributions
|
133 | 125 | FILENAME=`ls *.zip`
|
134 | 126 | unzip "$FILENAME" -d content
|
135 | 127 |
|
136 |
| - echo "::set-output name=filename::${FILENAME:0:-4}" |
| 128 | + echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT |
137 | 129 |
|
138 | 130 | # Store already-built plugin as an artifact for downloading
|
139 |
| - - name: Upload artifact |
140 |
| - uses: actions/upload-artifact@v3 |
141 |
| - with: |
142 |
| - name: ${{ steps.artifact.outputs.filename }} |
143 |
| - path: ./build/distributions/content/*/* |
| 131 | + - name : Upload artifact |
| 132 | + uses : actions/upload-artifact@v3 |
| 133 | + with : |
| 134 | + name : ${{ steps.artifact.outputs.filename }} |
| 135 | + path : ./build/distributions/content/*/* |
144 | 136 |
|
145 | 137 | # Prepare a draft release for GitHub Releases page for the manual verification
|
146 | 138 | # If accepted and published, release workflow would be triggered
|
147 |
| - releaseDraft: |
148 |
| - name: Release Draft |
149 |
| - if: github.event_name != 'pull_request' |
150 |
| - needs: build |
151 |
| - runs-on: ubuntu-latest |
152 |
| - permissions: |
153 |
| - contents: write |
154 |
| - steps: |
| 139 | + releaseDraft : |
| 140 | + name : Release Draft |
| 141 | + if : github.event_name != 'pull_request' |
| 142 | + needs : build |
| 143 | + runs-on : ubuntu-latest |
| 144 | + permissions : |
| 145 | + contents : write |
| 146 | + steps : |
155 | 147 |
|
156 | 148 | # Check out current repository
|
157 |
| - - name: Fetch Sources |
158 |
| - uses: actions/checkout@v3.3.0 |
159 |
| - |
160 |
| - # Remove old release drafts by using the curl request for the available releases with draft flag |
161 |
| - - name: Remove Old Release Drafts |
162 |
| - env: |
163 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
164 |
| - run: | |
| 149 | + - name : Fetch Sources |
| 150 | + uses : actions/checkout@v3 |
| 151 | + |
| 152 | + # Remove old release drafts by using the curl request for the available releases with a draft flag |
| 153 | + - name : Remove Old Release Drafts |
| 154 | + env : |
| 155 | + GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} |
| 156 | + run : | |
165 | 157 | gh api repos/{owner}/{repo}/releases \
|
166 | 158 | --jq '.[] | select(.draft == true) | .id' \
|
167 | 159 | | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
|
168 | 160 |
|
169 |
| - # Create new release draft - which is not publicly visible and requires manual acceptance |
170 |
| - - name: Create Release Draft |
171 |
| - env: |
172 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
173 |
| - run: | |
| 161 | + # Create a new release draft which is not publicly visible and requires manual acceptance |
| 162 | + - name : Create Release Draft |
| 163 | + env : |
| 164 | + GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} |
| 165 | + run : | |
174 | 166 | gh release create v${{ needs.build.outputs.version }} \
|
175 | 167 | --draft \
|
176 | 168 | --title "v${{ needs.build.outputs.version }}" \
|
|
0 commit comments