Skip to content

Commit

Permalink
Merge pull request #291 from plotly/automate-release
Browse files Browse the repository at this point in the history
Automate generation of build files
  • Loading branch information
ndrezn authored Apr 23, 2024
2 parents c1eef68 + f18e74f commit 295cc40
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Generate release

on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "v18.16.0"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
shell: bash
- name: Generate distribution
run: |
source .venv/bin/activate
npm i
npm run dist
npm pack && mv *.tgz dist/
shell: bash
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/*.whl,dist/*.tar.gz"
draft: true
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ And run the tests:
pytest
```

Create a new distribution with:
```
npm run dist
```

It doesn't need to be tested extensively, just enough to know that the table loads with no errors and you've built the right version of the code. If the app looks good, use [`twine`](https://pypi.org/project/twine/) to upload these to PyPI:
```
# back in the dash-ag-grid directory
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"format": "run-s private::format.*",
"private::lint.eslint": "eslint src",
"private::lint.prettier": "prettier src --list-different --ignore-path=.prettierignore",
"lint": "run-s private::lint.*"
"lint": "run-s private::lint.*",
"dist": "npm run build && python setup.py sdist bdist_wheel"
},
"author": "Plotly <chris@plot.ly>",
"license": "MIT",
Expand Down Expand Up @@ -84,4 +85,4 @@
"browserslist": [
"last 7 years and not dead"
]
}
}
3 changes: 2 additions & 1 deletion requires-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dash[ci,dev,testing]>=2.0
dash_mantine_components==0.12.1
pyyaml>=5.0
pytest<8.1.0
pytest<8.1.0
wheel

0 comments on commit 295cc40

Please sign in to comment.