Skip to content

Commit 0afd57a

Browse files
committed
Generate github releases
1 parent cc601bb commit 0afd57a

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,26 @@ jobs:
128128
name: pypi
129129
url: https://pypi.org/p/sphinx-lua-ls
130130
permissions:
131+
contents: write
131132
id-token: write
132133
steps:
133134
- name: Checkout source
134135
uses: actions/checkout@v4
135136
with:
136137
fetch-depth: 0
138+
- name: Generate release metadata
139+
id: metadata
140+
run: |
141+
ref="${{ github.ref }}";
142+
version=${ref#refs/tags/v};
143+
link="https://pypi.org/p/${{ github.repository }}/${version}";
144+
echo "version=${version}" >> $GITHUB_OUTPUT
145+
echo "link=${link}" >> $GITHUB_OUTPUT
146+
- name: Parse Changelog
147+
id: changelog
148+
uses: mindsers/changelog-reader-action@v2
149+
with:
150+
version: ${{ steps.metadata.outputs.version }}
137151
- name: Set up python 3.12
138152
uses: actions/setup-python@v4
139153
with:
@@ -153,6 +167,17 @@ jobs:
153167
uses: pypa/gh-action-pypi-publish@release/v1
154168
with:
155169
attestations: false
170+
- name: Create GitHub release
171+
uses: softprops/action-gh-release@v2
172+
with:
173+
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }}
174+
draft: ${{ steps.changelog.outputs.status == 'unreleased' }}
175+
body: |
176+
*Changelog:*
177+
178+
${{ steps.changelog.outputs.changes }}
179+
180+
[See release on PyPi](${{ steps.metadata.outputs.link }})
156181
157182
# Builds sphinx documentation.
158183
#

CHANGELOG.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

3-
## v3.3.0
3+
## [unreleased]
4+
5+
## [3.3.0]
46

57
- Added an option to extend list options (like `:exclude-members:`) without overriding
68
defaults:
@@ -20,7 +22,7 @@
2022

2123
[#19]: https://github.com/taminomara/sphinx-lua-ls/pull/19
2224

23-
## v3.2.0
25+
## [3.2.0]
2426

2527
- Updated a few dependencies. Most notably, restricted `sphinx` to `<9`.
2628

@@ -33,7 +35,7 @@
3335
[#18]: https://github.com/taminomara/sphinx-lua-ls/pull/18
3436
[@bkoropoff]: https://github.com/bkoropoff
3537

36-
## v3.1.0
38+
## [3.1.0]
3739

3840
- Added pygments lexer for Lua that highlights documentation tags.
3941

@@ -46,7 +48,7 @@
4648

4749
- Fixed some edge cases in parsing of type expressions.
4850

49-
## v3.0.0
51+
## [3.0.0]
5052

5153
- **Breaking change:** changed how `apidoc` generates file names to avoid collisions.
5254

@@ -114,18 +116,18 @@
114116
[EmmyLua]: https://github.com/EmmyLuaLs/emmylua-analyzer-rust/
115117
[#3]: https://github.com/taminomara/sphinx-lua-ls/issues/3
116118

117-
**Migrating to 3.0.0:**
119+
### Migrating to 3.0.0
118120

119121
- If you're using `apidoc`, you'll need to update links to your documentation.
120122

121123
- You'll need to explicitly specify which language server to use
122124
by including `lua_ls_backend` to your `conf.py`.
123125

124-
## v2.0.1
126+
## [2.0.1]
125127

126128
- Fixed documentation not being rebuilt after changing lua source code.
127129

128-
## v2.0.0
130+
## [2.0.0]
129131

130132
- **Breaking change:** don't implicitly convert classes that're derived from `table`
131133
to modules. Users should use a `!doctype` comment instead.
@@ -138,7 +140,7 @@
138140

139141
- Improved test coverage and fixed found bugs.
140142

141-
**Migrating to 2.0.0:**
143+
### Migrating to 2.0.0
142144

143145
In your Lua code base, perform global replace by regexp:
144146

@@ -157,7 +159,7 @@ Make sure that you only use `!doctype module` on the top-level
157159
tables that can be imported via `require`. On other objects,
158160
use `!doctype table` instead, otherwise you'll get errors that modules are not allowed within other objects.
159161

160-
## v1.1.0
162+
## [1.1.0]
161163

162164
- Added support for `!doc` and `!doctype` comments.
163165

@@ -176,6 +178,16 @@ use `!doctype table` instead, otherwise you'll get errors that modules are not a
176178

177179
- Fixed types when `lua:autoobject` would infer incorrect types for `data`.
178180

179-
## v1.0.0
181+
## [1.0.0]
180182

181183
Initial release.
184+
185+
[unreleased]: https://github.com/taminomara/sphinx-lua-ls/compare/v3.3.0...HEAD
186+
[3.3.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v3.2.0...v3.3.0
187+
[3.2.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v3.1.0...v3.2.0
188+
[3.1.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v3.0.0...v3.1.0
189+
[3.0.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v2.0.1...v3.0.0
190+
[2.0.1]: https://github.com/taminomara/sphinx-lua-ls/compare/v2.0.0...v2.0.1
191+
[2.0.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v1.1.0...v2.0.0
192+
[1.1.0]: https://github.com/taminomara/sphinx-lua-ls/compare/v1.0.0...v1.1.0
193+
[1.0.0]: https://github.com/taminomara/sphinx-lua-ls/releases/tag/v1.0.0

0 commit comments

Comments
 (0)