From f0d0e35eda9fa9d5c015b5267ff25059198b25d4 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Tue, 23 Apr 2024 23:24:17 +0100 Subject: [PATCH 1/9] Create python-publish.yml --- .github/workflows/python-publish.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..341b529 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,50 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + pip install -r requirements.txt + npm install + - name: Build package + run: | + npm run build + python setup.py sdist bdist_wheel + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 1c564e80acb8d7f690a9684c5495b81a04ebddc7 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 05:53:56 +0100 Subject: [PATCH 2/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 341b529..7f38db9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -37,6 +37,7 @@ jobs: run: | python -m pip install --upgrade pip pip install build + pip install wheel pip install -r requirements.txt npm install - name: Build package From c634584915a7b7d89930c95a1b28804870219967 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 06:07:25 +0100 Subject: [PATCH 3/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 7f38db9..c9934c4 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -37,7 +37,7 @@ jobs: run: | python -m pip install --upgrade pip pip install build - pip install wheel + pip install --upgrade pip setuptools wheel pip install -r requirements.txt npm install - name: Build package From 4bf1415242df5dd6e85f2c2e49833c257c84b694 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 06:09:35 +0100 Subject: [PATCH 4/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c9934c4..bdb29f3 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -43,7 +43,7 @@ jobs: - name: Build package run: | npm run build - python setup.py sdist bdist_wheel + python -m build - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From aaee427c32964e8333328a4b05268b508c22ef32 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 09:32:00 +0100 Subject: [PATCH 5/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index bdb29f3..b5adf31 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -25,6 +25,11 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: Version NPM Package + run: | + find . -name "*" -exec sed -i "s/__VERSION__/${{ github.ref_name }}/g" {} + - name: Set up Python uses: actions/setup-python@v3 with: From eaed8c2be9d1e168b6aa719ee77a2477bf66458a Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 09:32:25 +0100 Subject: [PATCH 6/9] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 205dc3c..a47f9db 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DashDragGrid" uuid = "1b08a953-4be3-4667-9a23-4015cbeafbd6" authors = ["Simon Unterbusch "] -version = "0.9.4" +version = "__VERSION__" [deps] Dash = "1b08a953-4be3-4667-9a23-3db579824955" From 9d549b37bf897fabaf55f27878287d2fb764c73a Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 09:32:49 +0100 Subject: [PATCH 7/9] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a5b5e4..b5e8879 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dash_drag_grid", - "version": "0.9.4", + "version": "__VERSION__", "description": "Draggable Toolbox grid based on react grid", "repository": { "type": "git", From df85ffe11403f009cce58748066d3910a59e58ad Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 09:39:41 +0100 Subject: [PATCH 8/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b5adf31..cca0595 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -26,18 +26,20 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Version NPM Package + - name: Versioning (${{ github.ref_name }}) run: | - find . -name "*" -exec sed -i "s/__VERSION__/${{ github.ref_name }}/g" {} + find . -name "*" -exec sed -i "s/__VERSION__/${{ github.ref_name }}/g" {} + - name: Set up Python uses: actions/setup-python@v3 with: python-version: '3.x' + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -45,10 +47,12 @@ jobs: pip install --upgrade pip setuptools wheel pip install -r requirements.txt npm install + - name: Build package run: | npm run build python -m build + - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From 63b649a1ab31546c7623e2b85f69bea999314768 Mon Sep 17 00:00:00 2001 From: John Grayson Date: Wed, 24 Apr 2024 09:41:59 +0100 Subject: [PATCH 9/9] Update python-publish.yml --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index cca0595..e4f1e56 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -28,7 +28,7 @@ jobs: - name: Versioning (${{ github.ref_name }}) run: | - find . -name "*" -exec sed -i "s/__VERSION__/${{ github.ref_name }}/g" {} + + find . -type f -exec sed -i "s/__VERSION__/${{ github.ref_name }}/g" {} + - name: Set up Python uses: actions/setup-python@v3