Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
Sync with sister (e4b257e..2eb2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Apr 9, 2024
1 parent 7a1e3b1 commit fce7406
Show file tree
Hide file tree
Showing 13 changed files with 333 additions and 178 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# GitHub Actions Workflow created for handling the release process based on the draft release prepared with the Build workflow.
# Running the publishPlugin task requires all following secrets to be provided: PUBLISH_TOKEN, PRIVATE_KEY, PRIVATE_KEY_PASSWORD, CERTIFICATE_CHAIN.
# See https://plugins.jetbrains.com/docs/intellij/plugin-signing.html for more information.

name: Publish

on:
release:
types:
- released

jobs:
release:
name: Publish
runs-on: ubuntu-latest
environment: publish

steps:
-
name: Fetch sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
-
name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
-
name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
-
name: Publish plugin to Marketplace
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: |
./gradlew publishPlugin
101 changes: 0 additions & 101 deletions .github/workflows/release.yaml

This file was deleted.

98 changes: 49 additions & 49 deletions .scripts/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,61 +6,61 @@


class Changelog:
_pattern: ClassVar[re.Pattern[str]] = re.compile(
r'''(?mix)
^\#\#\x20\[([^[\]]+)].*\n
((?s:.)+?)
(?=\n\#\#\x20)
'''
)

_text: str

def __init__(self, path: Path, /) -> None:
with open(path) as file:
self._text = file.read()

def __getitem__(self, heading: str) -> str | None:
return self.sections.get(heading)

@cached_property
def sections(self) -> dict[str, str]:
matches = self._pattern.finditer(self._text)

return {
match[1]: match[2].strip()
for match in matches
}

def get_section_or_unreleased(self, version: str) -> str:
return cast(str, self[version] or self['Unreleased'])
_pattern: ClassVar[re.Pattern[str]] = re.compile(
r'''(?mix)
^\#\#\x20\[([^[\]]+)].*\n
((?s:.)+?)
(?=\n\#\#\x20)
'''
)
_text: str
def __init__(self, path: Path, /) -> None:
with open(path) as file:
self._text = file.read()
def __getitem__(self, heading: str) -> str | None:
return self.sections.get(heading)
@cached_property
def sections(self) -> dict[str, str]:
matches = self._pattern.finditer(self._text)
return {
match[1]: match[2].strip()
for match in matches
}
def get_section_or_unreleased(self, version: str) -> str:
return cast(str, self[version] or self['Unreleased'])


class Changelogs:
user: Changelog
code: Changelog

def __init__(self) -> None:
root = Path(__file__).parent.parent

self.user = Changelog(root / 'CHANGELOG.md')
self.code = Changelog(root / 'CHANGELOG_CODE.md')

def get_changelog_for(self, version: str) -> str:
return '\n'.join([
'## For users',
'',
self.user.get_section_or_unreleased(version),
'\n',
'## For contributors',
'',
self.code.get_section_or_unreleased(version)
])
user: Changelog
code: Changelog
def __init__(self) -> None:
root = Path(__file__).parent.parent
self.user = Changelog(root / 'CHANGELOG.md')
self.code = Changelog(root / 'CHANGELOG_CODE.md')
def get_changelog_for(self, version: str) -> str:
return '\n'.join([
'## For users',
'',
self.user.get_section_or_unreleased(version),
'\n',
'## For contributors',
'',
self.code.get_section_or_unreleased(version)
])


def main(version: str) -> None:
print(Changelogs().get_changelog_for(version))
print(Changelogs().get_changelog_for(version))


if __name__ == '__main__':
main(sys.argv[1])
main(sys.argv[1])
28 changes: 14 additions & 14 deletions .scripts/edit_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@


def main(latest: str) -> None:
changelogs = Changelogs()
sections = changelogs.user.sections

for version in sections:
if version in ('Unreleased', latest):
continue

tag = f'v{version}'

subprocess.run([
'gh', 'release', 'edit', tag,
'--notes', changelogs.get_changelog_for(version)
])
changelogs = Changelogs()
sections = changelogs.user.sections
for version in sections:
if version in ('Unreleased', latest):
continue
tag = f'v{version}'
subprocess.run([
'gh', 'release', 'edit', tag,
'--notes', changelogs.get_changelog_for(version)
])


if __name__ == '__main__':
main(sys.argv[1])
main(sys.argv[1])
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For code changes, see [`CHANGELOG_CODE.md`][_-1].

### Fixed

* v0.1.0-poc.3 has a bug causing the configurations to not be saved.
* v0.1.0-poc.3 has a bug causing the configurations to be always unsavable.
This has been fixed.


Expand Down
19 changes: 16 additions & 3 deletions CHANGELOG_CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@ For user-facing changes, see [`CHANGELOG.md`][_-1].

### Added

* [`Settings.kt`][5-1] is added. (HEAD)
* [`Settings.kt`][10-1] is added. (HEAD)
* [`LICENSE_TEMPLATE.txt`][10-2] is added. (HEAD)

### Changed

* `released.yaml` is renamed to [`publish.yml`][10-3].
Steps overlapping with other jobs are removed. (HEAD)

### Fixed

* The project interpreter path is now correctly passed to Pyright.
(ba0947ba, HEAD)
(ba0947ba, 7a1e3b11)
* [`PyrightLSConfigurable`][10-4]'s `apply()`, `isModified()` and `reset()`
now call the corresponding methods of `panel`.
This fixes a(nother) regression introduced in v0.1.0-poc.3
which has been causing the configuration panels to be unresetable. (HEAD)

### Removed

* Support for versions lower than 2024.1 is discontinued. (92b029a5, d3fd01bf)


[5-1]: https://github.com/InSyncWithFoo/pyright-langserver-for-pycharm/blob/HEAD/src/main/kotlin/com/insyncwithfoo/pyrightls/server/Settings.kt
[10-1]: https://github.com/InSyncWithFoo/pyright-langserver-for-pycharm/blob/7a1e3b11/src/main/kotlin/com/insyncwithfoo/pyrightls/server/Settings.kt
[10-2]: https://github.com/InSyncWithFoo/pyright-langserver-for-pycharm/blob/HEAD/LICENSE_TEMPLATE.txt
[10-3]: https://github.com/InSyncWithFoo/pyright-langserver-for-pycharm/blob/HEAD/.github/workflows/publish.yaml
[10-4]: https://github.com/InSyncWithFoo/pyright-langserver-for-pycharm/blob/HEAD/src/main/kotlin/com/insyncwithfoo/pyrightls/configuration/PyrightLSConfigurable.kt


## [0.1.0-poc.4] - 2024-04-07
Expand Down
Loading

0 comments on commit fce7406

Please sign in to comment.