1- # GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
1+ # GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
22# - validate Gradle Wrapper,
33# - run 'test' and 'verifyPlugin' tasks,
44# - run Qodana inspections,
@@ -33,21 +33,27 @@ jobs:
3333 changelog : ${{ steps.properties.outputs.changelog }}
3434 steps :
3535
36+ # Free GitHub Actions Environment Disk Space
37+ - name : Maximize Build Space
38+ run : |
39+ sudo rm -rf /usr/share/dotnet
40+ sudo rm -rf /usr/local/lib/android
41+ sudo rm -rf /opt/ghc
42+
3643 # Check out current repository
3744 - name : Fetch Sources
38- uses : actions/checkout@v2.4.0
45+ uses : actions/checkout@v3
3946
4047 # Validate wrapper
4148 - name : Gradle Wrapper Validation
42- uses : gradle/wrapper-validation-action@v1.0.4
49+ uses : gradle/wrapper-validation-action@v1.0.5
4350
4451 # Setup Java 11 environment for the next steps
4552 - name : Setup Java
46- uses : actions/setup-java@v2
53+ uses : actions/setup-java@v3
4754 with :
4855 distribution : zulu
4956 java-version : 11
50- cache : gradle
5157
5258 # Set environment variables
5359 - name : Export Properties
@@ -58,29 +64,38 @@ jobs:
5864 VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
5965 NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
6066 CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
61- CHANGELOG="${CHANGELOG//'%'/'%25'}"
62- CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
63- CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
64- echo "::set-output name=version::$VERSION"
65- echo "::set-output name=name::$NAME"
66- echo "::set-output name=changelog::$CHANGELOG"
67- echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
67+
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+
6876 ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
77+
6978 # Run tests
7079 - name : Run Tests
71- run : ./gradlew test
80+ run : ./gradlew check
7281
7382 # Collect Tests Result of failed tests
7483 - name : Collect Tests Result
7584 if : ${{ failure() }}
76- uses : actions/upload-artifact@v2
85+ uses : actions/upload-artifact@v3
7786 with :
7887 name : tests-result
7988 path : ${{ github.workspace }}/build/reports/tests
8089
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+
8196 # Cache Plugin Verifier IDEs
8297 - name : Setup Plugin Verifier IDEs Cache
83- uses : actions/cache@v2.1.7
98+ uses : actions/cache@v3
8499 with :
85100 path : ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
86101 key : plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
@@ -92,14 +107,14 @@ jobs:
92107 # Collect Plugin Verifier Result
93108 - name : Collect Plugin Verifier Result
94109 if : ${{ always() }}
95- uses : actions/upload-artifact@v2
110+ uses : actions/upload-artifact@v3
96111 with :
97112 name : pluginVerifier-result
98113 path : ${{ github.workspace }}/build/reports/pluginVerifier
99114
100115 # Run Qodana inspections
101116 - name : Qodana - Code Inspection
102- uses : JetBrains/qodana-action@v4.2.5
117+ uses : JetBrains/qodana-action@v2022.3.0
103118
104119 # Prepare plugin archive content for creating artifact
105120 - name : Prepare Plugin Artifact
@@ -109,10 +124,12 @@ jobs:
109124 cd ${{ github.workspace }}/build/distributions
110125 FILENAME=`ls *.zip`
111126 unzip "$FILENAME" -d content
112- echo "::set-output name=filename::${FILENAME:0:-4}"
127+
128+ echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
129+
113130 # Store already-built plugin as an artifact for downloading
114131 - name : Upload artifact
115- uses : actions/upload-artifact@v2.2.4
132+ uses : actions/upload-artifact@v3
116133 with :
117134 name : ${{ steps.artifact.outputs.filename }}
118135 path : ./build/distributions/content/*/*
@@ -124,21 +141,24 @@ jobs:
124141 if : github.event_name != 'pull_request'
125142 needs : build
126143 runs-on : ubuntu-latest
144+ permissions :
145+ contents : write
127146 steps :
128147
129148 # Check out current repository
130149 - name : Fetch Sources
131- uses : actions/checkout@v2.4.0
150+ uses : actions/checkout@v3
132151
133- # Remove old release drafts by using the curl request for the available releases with draft flag
152+ # Remove old release drafts by using the curl request for the available releases with a draft flag
134153 - name : Remove Old Release Drafts
135154 env :
136155 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
137156 run : |
138157 gh api repos/{owner}/{repo}/releases \
139158 --jq '.[] | select(.draft == true) | .id' \
140159 | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
141- # Create new release draft - which is not publicly visible and requires manual acceptance
160+
161+ # Create a new release draft which is not publicly visible and requires manual acceptance
142162 - name : Create Release Draft
143163 env :
144164 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments