-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release Pygls to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
relase: | ||
name: "🚀 Release 🚢" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Python "3.10" | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
- name: Generate the latest changelog | ||
uses: orhun/git-cliff-action@v2 | ||
id: git-cliff | ||
with: | ||
args: --verbose --latest | ||
- name: Update the changelog | ||
run: | | ||
cat "${{ steps.git-cliff.outputs.contents }} | "sed -i "3r /dev/stdin" CHANGELOG.md | ||
git config --global user.name 'Github Action' | ||
git config --global user.email 'github.action@users.noreply.github.com' | ||
git commit -am "chore: update changelog" | ||
git push | ||
- name: Update CONTRIBUTORS.md | ||
run: | | ||
poetry run poe generate_contributors_md | ||
if [[ $(git diff --stat CONTRIBUTORS.md) != '' ]]; then | ||
git commit -am "chore: update CONTRIBUTORS.md" | ||
git push | ||
fi | ||
- name: Release | ||
run: | | ||
poetry build | ||
poetry publish --username "__token__" --password ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
# Contributors (alphabetical) | ||
|
||
- [@augb](https://github.com/augb) | ||
- [Alex Carney](https://github.com/alcarney) | ||
- [Brett Cannon](https://github.com/brettcannon/) | ||
- [Daniel Elero](https://github.com/danixeee) | ||
- [Daniel Miller](https://github.com/millerdev) | ||
- [DeathAxe](https://github.com/deathaxe) | ||
- [Denis Loginov](https://github.com/dinvlad) | ||
- [Dillan Mills](https://github.com/DillanCMills) | ||
- [Felicián Németh](https://github.com/nemethf) | ||
- [Felix Yan](https://github.com/felixonmars) | ||
- [Jelle van der Waa](https://github.com/jelly) | ||
- [Jérome Perrin](https://github.com/perrinjerome) | ||
- [Karthik Nadig](https://github.com/karthiknadig) | ||
- [Laurence Warne](https://github.com/LaurenceWarne) | ||
- [Matej Kašťák](https://github.com/MatejKastak) | ||
- [Max O'Cull](https://github.com/Maxattax97) | ||
- [Samuel Roeca](https://github.com/pappasam) | ||
- [Tom BH](https://github.com/tombh) | ||
- [Tomoya Tanjo](https://github.com/tom-tan) | ||
- [bollwyvl](https://github.com/bollwyvl) | ||
- [yorodm](https://github.com/yorodm) | ||
# Contributors (contributions) | ||
* [alcarney](https://github.com/alcarney) (57) | ||
* [anu-ka](https://github.com/anu-ka) (1) | ||
* [augb](https://github.com/augb) (35) | ||
* [berquist](https://github.com/berquist) (1) | ||
* [brettcannon](https://github.com/brettcannon) (2) | ||
* [D4N](https://github.com/D4N) (1) | ||
* [danixeee](https://github.com/danixeee) (321) | ||
* [deathaxe](https://github.com/deathaxe) (24) | ||
* [dependabot[bot]](https://github.com/apps/dependabot) (5) | ||
* [dgreisen](https://github.com/dgreisen) (4) | ||
* [DillanCMills](https://github.com/DillanCMills) (1) | ||
* [dimbleby](https://github.com/dimbleby) (9) | ||
* [dinvlad](https://github.com/dinvlad) (9) | ||
* [eirikpre](https://github.com/eirikpre) (1) | ||
* [felixonmars](https://github.com/felixonmars) (1) | ||
* [HankBO](https://github.com/HankBO) (1) | ||
* [jelly](https://github.com/jelly) (1) | ||
* [karthiknadig](https://github.com/karthiknadig) (1) | ||
* [KOLANICH](https://github.com/KOLANICH) (3) | ||
* [LaurenceWarne](https://github.com/LaurenceWarne) (2) | ||
* [MatejKastak](https://github.com/MatejKastak) (3) | ||
* [muffinmad](https://github.com/muffinmad) (2) | ||
* [nemethf](https://github.com/nemethf) (1) | ||
* [otreblan](https://github.com/otreblan) (1) | ||
* [pappasam](https://github.com/pappasam) (7) | ||
* [perimosocordiae](https://github.com/perimosocordiae) (1) | ||
* [perrinjerome](https://github.com/perrinjerome) (24) | ||
* [renatav](https://github.com/renatav) (2) | ||
* [tombh](https://github.com/tombh) (29) | ||
* [tsugumi-sys](https://github.com/tsugumi-sys) (1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
""" | ||
Example JSON object: | ||
{ | ||
"login": "danixeee", | ||
"id": 16227576, | ||
"node_id": "MDQ6VXNlcjE2MjI3NTc2", | ||
"avatar_url": "https://avatars.githubusercontent.com/u/16227576?v=4", | ||
"gravatar_id": "", | ||
"url": "https://api.github.com/users/danixeee", | ||
"html_url": "https://github.com/danixeee", | ||
"followers_url": "https://api.github.com/users/danixeee/followers", | ||
"following_url": "https://api.github.com/users/danixeee/following{/other_user}", | ||
"gists_url": "https://api.github.com/users/danixeee/gists{/gist_id}", | ||
"starred_url": "https://api.github.com/users/danixeee/starred{/owner}{/repo}", | ||
"subscriptions_url": "https://api.github.com/users/danixeee/subscriptions", | ||
"organizations_url": "https://api.github.com/users/danixeee/orgs", | ||
"repos_url": "https://api.github.com/users/danixeee/repos", | ||
"events_url": "https://api.github.com/users/danixeee/events{/privacy}", | ||
"received_events_url": "https://api.github.com/users/danixeee/received_events", | ||
"type": "User", | ||
"site_admin": false, | ||
"contributions": 321 | ||
} | ||
""" | ||
|
||
import requests | ||
|
||
PYGLS_CONTRIBUTORS_JSON_URL = "https://api.github.com/repos/openlawlibrary/pygls/contributors" | ||
CONTRIBUTORS_FILE = "CONTRIBUTORS.md" | ||
|
||
response = requests.get(PYGLS_CONTRIBUTORS_JSON_URL) | ||
contributors = sorted(response.json(), key=lambda d: d["login"].lower()) | ||
|
||
contents = "# Contributors (contributions)\n" | ||
|
||
for contributor in contributors: | ||
name = contributor["login"] | ||
contributions = contributor["contributions"] | ||
url = contributor["html_url"] | ||
contents += f'* [{name}]({url}) ({contributions})\n' | ||
|
||
file = open(CONTRIBUTORS_FILE, "w") | ||
n = file.write(contents) | ||
file.close() | ||
|
||
print("✅ CONTRIBUTORS.md updated") |