From d34460e0678cfb5303aee7aeb4d3adbcf279925d Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 21 Feb 2025 14:29:09 -0600 Subject: [PATCH 1/6] Add initial test pypi release workflow --- .github/workflows/test-release.yml | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/test-release.yml diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 0000000000..32424e5e77 --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,66 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install Node + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install npm dependencies + run: >- + cd js + npm ci + npm run build + + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/plotly + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file From 0f25bd4dc3c97b54bf11095d41443d9bd8ed02aa Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 21 Feb 2025 14:32:25 -0600 Subject: [PATCH 2/6] Syntax error --- .github/workflows/test-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 32424e5e77..01d2468a5c 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -22,7 +22,7 @@ jobs: node-version: '14' - name: Install npm dependencies - run: >- + run: | cd js npm ci npm run build From efe9451589b646666309bd315d484a6dcb18932f Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 21 Feb 2025 14:58:46 -0600 Subject: [PATCH 3/6] Raise node version and use verbose flag for debugging --- .github/workflows/test-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index 01d2468a5c..dbba713452 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -19,13 +19,13 @@ jobs: - name: Install Node uses: actions/setup-node@v2 with: - node-version: '14' + node-version: '18' - name: Install npm dependencies run: | cd js - npm ci - npm run build + npm ci --verbose + npm run build --verbose - name: Install pypa/build run: >- From bf7874ef128b9c1e4ff03faf447e77b648ca900a Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Wed, 26 Mar 2025 13:21:40 -0500 Subject: [PATCH 4/6] build From aba1f3d3a50e6731c0eaa3ba8f03dd7e290204f3 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Wed, 26 Mar 2025 15:32:42 -0500 Subject: [PATCH 5/6] Only run on push to main or release branches --- .github/workflows/test-release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index dbba713452..ca3b5ecc63 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -1,6 +1,10 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI -on: push +on: + push: + branches: + - main + - 'releases/**' jobs: build: From d0c2ec42b59185e2c5be1f171eaf809a8e4e529e Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Wed, 26 Mar 2025 15:39:42 -0500 Subject: [PATCH 6/6] Add workflow dispatch for manual triggering github actions --- .github/workflows/test-release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml index ca3b5ecc63..12d6e03955 100644 --- a/.github/workflows/test-release.yml +++ b/.github/workflows/test-release.yml @@ -1,10 +1,7 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI on: - push: - branches: - - main - - 'releases/**' + workflow_dispatch jobs: build: