From 86cc717bd531760330fdccab4a3f349b562d59d1 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 23 Apr 2024 10:50:04 -0400 Subject: [PATCH 1/4] Add automatic release on tag --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ package.json | 5 +++-- requires-dev.txt | 3 ++- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ac428fc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +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 + - run: | + source .venv/bin/activate + npm i + npm run dist + shell: bash + - uses: ncipollo/release-action@v1 + with: + artifacts: "dist/*.whl,dist/*.tar.gz" + draft: true \ No newline at end of file diff --git a/package.json b/package.json index 9cf832f..12a337a 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "MIT", @@ -84,4 +85,4 @@ "browserslist": [ "last 7 years and not dead" ] -} +} \ No newline at end of file diff --git a/requires-dev.txt b/requires-dev.txt index 92eba92..644dbde 100644 --- a/requires-dev.txt +++ b/requires-dev.txt @@ -1,4 +1,5 @@ dash[ci,dev,testing]>=2.0 dash_mantine_components==0.12.1 pyyaml>=5.0 -pytest<8.1.0 \ No newline at end of file +pytest<8.1.0 +wheel \ No newline at end of file From 6c60e251bee0e1ad55d53100c27f94a6f5a3b768 Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 23 Apr 2024 10:54:39 -0400 Subject: [PATCH 2/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7557654..da89907 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 From 869733662c0cb726221d071e56831d38d162c54c Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 23 Apr 2024 10:54:54 -0400 Subject: [PATCH 3/4] Bundle npm pack files --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac428fc..6f908ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,7 @@ jobs: source .venv/bin/activate npm i npm run dist + npm pack && mv *.tgz dist/ shell: bash - uses: ncipollo/release-action@v1 with: From f18e74f286318beae69b05dc05e8370ed0060faa Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 23 Apr 2024 11:04:52 -0400 Subject: [PATCH 4/4] Name step --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f908ec..f1a021e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,8 @@ jobs: curl -LsSf https://astral.sh/uv/install.sh | sh uv venv shell: bash - - run: | + - name: Generate distribution + run: | source .venv/bin/activate npm i npm run dist