From cf40e84dbc64bbcdd900a3156a24b2770552d5be Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 25 Nov 2022 11:56:12 +0100 Subject: [PATCH 1/4] Add Github Actions workflow to build and publish --- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++++ environment.yml | 2 ++ setup.py | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..47cbb26 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,26 @@ +name: Build and upload to PyPI +on: [push] + +jobs: + build_artifacts: + name: Build artifacts + runs-on: ubuntu-latest + strategy: + fail-fast: true + steps: + - uses: actions/checkout@v3 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-variant: Mambaforge + miniforge-version: 22.9.0-2 + use-mamba: true + environment-file: environment.yml + activate-environment: vscode-binder + - shell: bash -el {0} + run: + python -m build + - uses: pypa/gh-action-pypi-publish@v1.5.1 + if: startsWith(github.ref, 'refs/tags/') + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/environment.yml b/environment.yml index bc2c718..7ea9cee 100644 --- a/environment.yml +++ b/environment.yml @@ -1,6 +1,8 @@ +name: vscode-binder channels: - conda-forge dependencies: - numpy + - python-build - jupyter-server-proxy - code-server >=3.2 diff --git a/setup.py b/setup.py index f51d1b7..942409f 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="jupyter-vscode-proxy", - version="0.1", + version="0.2", url="https://github.com/betatim/vscode-binder", author="Tim Head", license="BSD", From a1a5f79822b7bde01ef7b3ac7e39bdad8a253da2 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 25 Nov 2022 14:28:13 +0100 Subject: [PATCH 2/4] Upload on release --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 47cbb26..89dc31f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: run: python -m build - uses: pypa/gh-action-pypi-publish@v1.5.1 - if: startsWith(github.ref, 'refs/tags/') + if: github.event_name == 'release' with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} From 8a44db07ac141bde7c46c6cc4a4139f072905c4b Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 25 Nov 2022 14:30:36 +0100 Subject: [PATCH 3/4] Add release trigger --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89dc31f..786b554 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,5 @@ name: Build and upload to PyPI -on: [push] +on: [push, release] jobs: build_artifacts: From 07bbff2e93fce1a9e92a3e01e3b848b7bc90d5f3 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 25 Nov 2022 19:49:25 +0100 Subject: [PATCH 4/4] Update .github/workflows/ci.yaml Co-authored-by: Tim Head --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 786b554..278cf7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,4 +23,4 @@ jobs: if: github.event_name == 'release' with: user: __token__ - password: ${{ secrets.PYPI_TOKEN }} + password: ${{ secrets.PYPI_RELEASE_TOKEN }}