Skip to content

Commit 9e2c860

Browse files
committed
[NEW] OdooLS for PyCharm: initial commit
0 parents  commit 9e2c860

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2360
-0
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# Maintain dependencies for Gradle dependencies
7+
- package-ecosystem: "gradle"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"
11+
# Maintain dependencies for GitHub Actions
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"

.github/workflows/build.yml

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2+
# - Validate Gradle Wrapper.
3+
# - Run 'test' and 'verifyPlugin' tasks.
4+
# - Run Qodana inspections.
5+
# - Run the 'buildPlugin' task and prepare artifact for further tests.
6+
# - Run the 'runPluginVerifier' task.
7+
# - Create a draft release.
8+
#
9+
# The workflow is triggered on push and pull_request events.
10+
#
11+
# GitHub Actions reference: https://help.github.com/en/actions
12+
#
13+
## JBIJPPTPL
14+
15+
name: Build
16+
on:
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 ]
20+
# Trigger the workflow on any pull request
21+
pull_request:
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
29+
# Prepare the environment and build the plugin
30+
build:
31+
name: Build
32+
runs-on: ubuntu-latest
33+
steps:
34+
35+
# Free GitHub Actions Environment Disk Space
36+
- name: Maximize Build Space
37+
uses: jlumbroso/[email protected]
38+
with:
39+
tool-cache: false
40+
large-packages: false
41+
42+
# Check out the current repository
43+
- name: Fetch Sources
44+
uses: actions/checkout@v4
45+
46+
# Set up the Java environment for the next steps
47+
- name: Setup Java
48+
uses: actions/setup-java@v4
49+
with:
50+
distribution: zulu
51+
java-version: 21
52+
53+
# Setup Gradle
54+
- name: Setup Gradle
55+
uses: gradle/actions/setup-gradle@v4
56+
57+
# Build plugin
58+
- name: Build plugin
59+
run: ./gradlew buildPlugin
60+
61+
# Prepare plugin archive content for creating artifact
62+
- name: Prepare Plugin Artifact
63+
id: artifact
64+
shell: bash
65+
run: |
66+
cd ${{ github.workspace }}/build/distributions
67+
FILENAME=`ls *.zip`
68+
unzip "$FILENAME" -d content
69+
70+
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
71+
72+
# Store an already-built plugin as an artifact for downloading
73+
- name: Upload artifact
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: ${{ steps.artifact.outputs.filename }}
77+
path: ./build/distributions/content/*/*
78+
79+
# Run tests and upload a code coverage report
80+
test:
81+
name: Test
82+
needs: [ build ]
83+
runs-on: ubuntu-latest
84+
steps:
85+
86+
# Free GitHub Actions Environment Disk Space
87+
- name: Maximize Build Space
88+
uses: jlumbroso/[email protected]
89+
with:
90+
tool-cache: false
91+
large-packages: false
92+
93+
# Check out the current repository
94+
- name: Fetch Sources
95+
uses: actions/checkout@v4
96+
97+
# Set up the Java environment for the next steps
98+
- name: Setup Java
99+
uses: actions/setup-java@v4
100+
with:
101+
distribution: zulu
102+
java-version: 21
103+
104+
# Setup Gradle
105+
- name: Setup Gradle
106+
uses: gradle/actions/setup-gradle@v4
107+
with:
108+
cache-read-only: true
109+
110+
# Run tests
111+
- name: Run Tests
112+
run: ./gradlew check
113+
114+
# Collect Tests Result of failed tests
115+
- name: Collect Tests Result
116+
if: ${{ failure() }}
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: tests-result
120+
path: ${{ github.workspace }}/build/reports/tests
121+
122+
# Upload the Kover report to CodeCov
123+
- name: Upload Code Coverage Report
124+
uses: codecov/codecov-action@v5
125+
with:
126+
files: ${{ github.workspace }}/build/reports/kover/report.xml
127+
token: ${{ secrets.CODECOV_TOKEN }}
128+
129+
# Run Qodana inspections and provide a report
130+
inspectCode:
131+
name: Inspect code
132+
needs: [ build ]
133+
runs-on: ubuntu-latest
134+
permissions:
135+
contents: write
136+
checks: write
137+
pull-requests: write
138+
steps:
139+
140+
# Free GitHub Actions Environment Disk Space
141+
- name: Maximize Build Space
142+
uses: jlumbroso/[email protected]
143+
with:
144+
tool-cache: false
145+
large-packages: false
146+
147+
# Check out the current repository
148+
- name: Fetch Sources
149+
uses: actions/checkout@v4
150+
with:
151+
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
152+
fetch-depth: 0 # a full history is required for pull request analysis
153+
154+
# Set up the Java environment for the next steps
155+
- name: Setup Java
156+
uses: actions/setup-java@v4
157+
with:
158+
distribution: zulu
159+
java-version: 21
160+
161+
# Run Qodana inspections
162+
- name: Qodana - Code Inspection
163+
uses: JetBrains/[email protected]
164+
with:
165+
cache-default-branch-only: true
166+
167+
# Run plugin structure verification along with IntelliJ Plugin Verifier
168+
verify:
169+
name: Verify plugin
170+
needs: [ build ]
171+
runs-on: ubuntu-latest
172+
steps:
173+
174+
# Free GitHub Actions Environment Disk Space
175+
- name: Maximize Build Space
176+
uses: jlumbroso/[email protected]
177+
with:
178+
tool-cache: false
179+
large-packages: false
180+
181+
# Check out the current repository
182+
- name: Fetch Sources
183+
uses: actions/checkout@v4
184+
185+
# Set up the Java environment for the next steps
186+
- name: Setup Java
187+
uses: actions/setup-java@v4
188+
with:
189+
distribution: zulu
190+
java-version: 21
191+
192+
# Setup Gradle
193+
- name: Setup Gradle
194+
uses: gradle/actions/setup-gradle@v4
195+
with:
196+
cache-read-only: true
197+
198+
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
199+
- name: Run Plugin Verification tasks
200+
run: ./gradlew verifyPlugin
201+
202+
# Collect Plugin Verifier Result
203+
- name: Collect Plugin Verifier Result
204+
if: ${{ always() }}
205+
uses: actions/upload-artifact@v4
206+
with:
207+
name: pluginVerifier-result
208+
path: ${{ github.workspace }}/build/reports/pluginVerifier
209+
210+
# Prepare a draft release for GitHub Releases page for the manual verification
211+
# If accepted and published, the release workflow would be triggered
212+
releaseDraft:
213+
name: Release draft
214+
if: github.event_name != 'pull_request'
215+
needs: [ build, test, inspectCode, verify ]
216+
runs-on: ubuntu-latest
217+
permissions:
218+
contents: write
219+
steps:
220+
221+
# Check out the current repository
222+
- name: Fetch Sources
223+
uses: actions/checkout@v4
224+
225+
# Remove old release drafts by using the curl request for the available releases with a draft flag
226+
- name: Remove Old Release Drafts
227+
env:
228+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229+
run: |
230+
gh api repos/{owner}/{repo}/releases \
231+
--jq '.[] | select(.draft == true) | .id' \
232+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
233+
234+
# Create a new release draft which is not publicly visible and requires manual acceptance
235+
- name: Create Release Draft
236+
env:
237+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238+
run: |
239+
VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ')
240+
RELEASE_NOTE="./build/tmp/release_note.txt"
241+
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE
242+
243+
gh release create $VERSION \
244+
--draft \
245+
--title $VERSION \
246+
--notes-file $RELEASE_NOTE

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
2+
# Running the publishPlugin task requires all the following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
3+
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.
4+
5+
name: Release
6+
on:
7+
release:
8+
types: [prereleased, released]
9+
10+
jobs:
11+
12+
# Prepare and publish the plugin to JetBrains Marketplace repository
13+
release:
14+
name: Publish Plugin
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
steps:
20+
21+
# Free GitHub Actions Environment Disk Space
22+
- name: Maximize Build Space
23+
uses: jlumbroso/[email protected]
24+
with:
25+
tool-cache: false
26+
large-packages: false
27+
28+
# Check out the current repository
29+
- name: Fetch Sources
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.release.tag_name }}
33+
34+
# Set up the Java environment for the next steps
35+
- name: Setup Java
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: zulu
39+
java-version: 21
40+
41+
# Setup Gradle
42+
- name: Setup Gradle
43+
uses: gradle/actions/setup-gradle@v4
44+
with:
45+
cache-read-only: true
46+
47+
# Update the Unreleased section with the current release note
48+
- name: Patch Changelog
49+
if: ${{ github.event.release.body != '' }}
50+
env:
51+
CHANGELOG: ${{ github.event.release.body }}
52+
run: |
53+
RELEASE_NOTE="./build/tmp/release_note.txt"
54+
echo "$CHANGELOG" > $RELEASE_NOTE
55+
56+
${{ github.event.release.body }}
57+
./gradlew patchChangelog --release-note-file=$RELEASE_NOTE
58+
59+
# Publish the plugin to JetBrains Marketplace
60+
- name: Publish Plugin
61+
env:
62+
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
63+
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
64+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
65+
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
66+
run: ./gradlew publishPlugin
67+
68+
# Upload an artifact as a release asset
69+
- name: Upload Release Asset
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/*
73+
74+
# Create a pull request
75+
- name: Create Pull Request
76+
if: ${{ steps.properties.outputs.changelog != '' }}
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
run: |
80+
VERSION="${{ github.event.release.tag_name }}"
81+
BRANCH="changelog-update-$VERSION"
82+
LABEL="release changelog"
83+
84+
git config user.email "[email protected]"
85+
git config user.name "GitHub Action"
86+
87+
git checkout -b $BRANCH
88+
git commit -am "Changelog update - $VERSION"
89+
git push --set-upstream origin $BRANCH
90+
91+
gh label create "$LABEL" \
92+
--description "Pull requests with release changelog update" \
93+
--force \
94+
|| true
95+
96+
gh pr create \
97+
--title "Changelog update - \`$VERSION\`" \
98+
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
99+
--label "$LABEL" \
100+
--head $BRANCH

0 commit comments

Comments
 (0)