Skip to content

Commit 4f77c24

Browse files
committed
chore: switch to gh-release action
1 parent c37d8a0 commit 4f77c24

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

.github/workflows/build-test-package-publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,30 +219,34 @@ jobs:
219219
id: upload-vscode-package
220220
uses: actions/upload-artifact@v4
221221
with:
222+
name: vscode-package
222223
path: dist/robotcode*.vsix
223224

224225
- name: Upload python package
225226
id: upload-python-package
226227
uses: actions/upload-artifact@v4
227228
with:
229+
name: python-package
228230
path: dist/*.tar.gz
229231

230232
- name: Upload python wheel package
231233
id: upload-wheel-package
232234
uses: actions/upload-artifact@v4
233235
with:
236+
name: wheel-package
234237
path: dist/*.whl
235238

236239
- name: Upload intellij plugin
237240
id: upload-intellij-package
238241
uses: actions/upload-artifact@v4
239242
with:
243+
name: intellij-package
240244
path: intellij-client/build/distributions/*.zip
241245

242246
publish:
243247
runs-on: ubuntu-latest
244248
needs: [code-quality, package]
245-
if: success() && startsWith( github.ref, 'refs/tags/v')
249+
if: success()
246250
steps:
247251
- uses: actions/checkout@v4
248252
with:
@@ -292,16 +296,19 @@ jobs:
292296
hatch -q run build:extract-release-notes > ./auto_relnotes.md
293297
294298
echo "is_prelease=$(hatch -q run build:is-prerelease)" >> $GITHUB_OUTPUT
299+
echo "release_version=$(hatch -q run build:get-release-version)" >> $GITHUB_OUTPUT
295300
296301
- name: create github release
297-
uses: ncipollo/release-action@v1
302+
uses: softprops/action-gh-release@v2
298303
with:
299-
artifacts: "dist/*"
304+
files: "dist/*"
305+
name: "v${{ steps.get_release_informations.outputs.release_version }}"
300306
prerelease: ${{ steps.get_release_informations.outputs.is_prelease }}
301-
bodyFile: ./auto_relnotes.md
307+
body_path: ./auto_relnotes.md
302308
token: ${{ secrets.GITHUB_TOKEN }}
303309

304310
- name: publish vsix and python packages
311+
if: github.ref_type == 'tag' && startsWith( github.ref, 'refs/tags/v')
305312
run: hatch -q run build:publish
306313
env:
307314
VSCE_PAT: ${{ secrets.VSCE_PAT }}

hatch.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ package = ["python scripts/package.py"]
173173
publish = ["python scripts/publish.py"]
174174
extract-release-notes = ["python scripts/extract_release_notes.py"]
175175
is-prerelease = ["python scripts/is_prerelease.py"]
176+
get-release-version = ["python scripts/get_release_version.py"]
176177
bump = ["cz bump {args}"]
177178
install-bundled-editable = "python ./scripts/install_bundled_editable.py"
178179

scripts/get_release_version.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import contextlib
2+
import sys
3+
from pathlib import Path
4+
5+
if __name__ == "__main__" and not __package__:
6+
file = Path(__file__).resolve()
7+
parent, top = file.parent, file.parents[1]
8+
9+
if str(top) not in sys.path:
10+
sys.path.append(str(top))
11+
12+
with contextlib.suppress(ValueError):
13+
sys.path.remove(str(parent))
14+
15+
__package__ = "scripts"
16+
17+
18+
from scripts.tools import get_version
19+
20+
21+
def main() -> None:
22+
print(get_version())
23+
24+
25+
if __name__ == "__main__":
26+
main()

0 commit comments

Comments
 (0)