Skip to content

Commit 0c5fa03

Browse files
committed
workflow package with poetry calling npm
1 parent 6d04a79 commit 0c5fa03

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
130130
- name: package
131131
run: |
132-
npm run package
132+
poetry run npm-package
133133
134134
- name: Upload VSCode package
135135
uses: actions/upload-artifact@v2

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ classifiers = [
4848
"Topic :: Text Editors :: Integrated Development Environments (IDE)",
4949
]
5050

51+
[tool.poetry.scripts]
52+
npm-package = 'scripts.npm_package:main'
53+
npm-publish = 'scripts.npm_publish:main'
54+
5155
[tool.poetry.dependencies]
5256
python = "^3.8"
5357
robotframework = {version = ">=4.0.0", allow-prereleases = false}

scripts/npm_package.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from subprocess import run
2+
3+
4+
def main() -> None:
5+
run(["npm", "run", "package"], shell=True).check_returncode()
6+
7+
8+
if __name__ == "__main__":
9+
main()

scripts/npm_publish.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from subprocess import run
2+
3+
4+
def main() -> None:
5+
run(["npm", "run", "publish"], shell=True).check_returncode()
6+
7+
8+
if __name__ == "__main__":
9+
main()

0 commit comments

Comments
 (0)