|
8 | 8 | branches: |
9 | 9 | -main |
10 | 10 | -eap |
| 11 | + -test |
11 | 12 | pull_request: |
12 | 13 |
|
13 | 14 | jobs: |
@@ -41,124 +42,3 @@ jobs: |
41 | 42 | with: |
42 | 43 | name:tests-result |
43 | 44 | path:${{ github.workspace }}/build/reports/tests |
44 | | - |
45 | | -# Run Gradle Wrapper Validation Action to verify the wrapper's checksum. Run |
46 | | -# verifyPlugin and IntelliJ Plugin Verifier. Build plugin and provide the |
47 | | -# artifact for the next workflow jobs. |
48 | | -build: |
49 | | -name:Build |
50 | | -needs:test |
51 | | -runs-on:ubuntu-latest |
52 | | -outputs: |
53 | | -version:${{ steps.properties.outputs.version }} |
54 | | -changelog:${{ steps.properties.outputs.changelog }} |
55 | | -steps: |
56 | | -# Check out current repository |
57 | | - -name:Fetch Sources |
58 | | -uses:actions/checkout@v4.1.1 |
59 | | - |
60 | | -# Setup Java 11 environment for the next steps |
61 | | - -name:Setup Java |
62 | | -uses:actions/setup-java@v4 |
63 | | -with: |
64 | | -distribution:zulu |
65 | | -java-version:17 |
66 | | -cache:gradle |
67 | | - |
68 | | -# Set environment variables |
69 | | - -name:Export Properties |
70 | | -id:properties |
71 | | -shell:bash |
72 | | -run:| |
73 | | - PROPERTIES="$(./gradlew properties --console=plain -q)" |
74 | | - VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')" |
75 | | - NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')" |
76 | | - CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)" |
77 | | - CHANGELOG="${CHANGELOG//'%'/'%25'}" |
78 | | - CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" |
79 | | - CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" |
80 | | - echo "::set-output name=version::$VERSION" |
81 | | - echo "::set-output name=name::$NAME" |
82 | | - echo "::set-output name=changelog::$CHANGELOG" |
83 | | - echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier" |
84 | | - ./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier |
85 | | -
|
86 | | -# Run plugin build |
87 | | - -name:Run Build |
88 | | -run:./gradlew clean buildPlugin --info |
89 | | - |
90 | | -# until https://github.com/JetBrains/gradle-intellij-plugin/issues/1027 is solved |
91 | | - |
92 | | -# # Cache Plugin Verifier IDEs |
93 | | -# - name: Setup Plugin Verifier IDEs Cache |
94 | | -# uses: actions/cache@v2.1.7 |
95 | | -# with: |
96 | | -# path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides |
97 | | -# key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }} |
98 | | -# |
99 | | -# # Run Verify Plugin task and IntelliJ Plugin Verifier tool |
100 | | -# - name: Run Plugin Verification tasks |
101 | | -# run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }} |
102 | | -# |
103 | | -# # Collect Plugin Verifier Result |
104 | | -# - name: Collect Plugin Verifier Result |
105 | | -# if: ${{ always() }} |
106 | | -# uses: actions/upload-artifact@v4 |
107 | | -# with: |
108 | | -# name: pluginVerifier-result |
109 | | -# path: ${{ github.workspace }}/build/reports/pluginVerifier |
110 | | - |
111 | | -# Run Qodana inspections |
112 | | - -name:Qodana - Code Inspection |
113 | | -uses:JetBrains/qodana-action@v2023.3.0 |
114 | | - |
115 | | -# Prepare plugin archive content for creating artifact |
116 | | - -name:Prepare Plugin Artifact |
117 | | -id:artifact |
118 | | -shell:bash |
119 | | -run:| |
120 | | - cd ${{ github.workspace }}/build/distributions |
121 | | - FILENAME=`ls *.zip` |
122 | | - unzip "$FILENAME" -d content |
123 | | - echo "::set-output name=filename::${FILENAME:0:-4}" |
124 | | -# Store already-built plugin as an artifact for downloading |
125 | | - -name:Upload artifact |
126 | | -uses:actions/upload-artifact@v4 |
127 | | -with: |
128 | | -name:${{ steps.artifact.outputs.filename }} |
129 | | -path:./build/distributions/content/*/* |
130 | | - |
131 | | -# Prepare a draft release for GitHub Releases page for the manual verification |
132 | | -# If accepted and published, release workflow would be triggered |
133 | | -releaseDraft: |
134 | | -name:Release Draft |
135 | | -if:github.event_name != 'pull_request' |
136 | | -needs:build |
137 | | -runs-on:ubuntu-latest |
138 | | -steps: |
139 | | - |
140 | | -# Check out current repository |
141 | | - -name:Fetch Sources |
142 | | -uses:actions/checkout@v4.1.1 |
143 | | - |
144 | | -# Remove old release drafts by using the curl request for the available releases with draft flag |
145 | | - -name:Remove Old Release Drafts |
146 | | -env: |
147 | | -GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }} |
148 | | -run:| |
149 | | - gh api repos/{owner}/{repo}/releases \ |
150 | | - --jq '.[] | select(.draft == true) | .id' \ |
151 | | - | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} |
152 | | -# Create new release draft - which is not publicly visible and requires manual acceptance |
153 | | - -name:Create Release Draft |
154 | | -env: |
155 | | -GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }} |
156 | | -run:| |
157 | | - gh release create v${{ needs.build.outputs.version }} \ |
158 | | - --draft \ |
159 | | - --target ${GITHUB_REF_NAME} \ |
160 | | - --title "v${{ needs.build.outputs.version }}" \ |
161 | | - --notes "$(cat << 'EOM' |
162 | | - ${{ needs.build.outputs.changelog }} |
163 | | - EOM |
164 | | - )" |