From cb760f9861b3fefd79a4046d4e2d23ab32ee56ac Mon Sep 17 00:00:00 2001 From: Shi Fan Date: Thu, 15 Oct 2020 14:20:02 -0400 Subject: [PATCH 1/3] Add github actions for auto-release --- .github/workflows/pypi.yml | 102 +++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..deeac3bf --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,102 @@ +name: PyPI +on: + push: + branches: + - master + - auto-release + pull_request: + branches: [master] + release: + types: [published] + +jobs: + build_gateway: + name: Build source distribution - dask-gateway + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Build dask-gateway as an sdist and a bdist_wheel + run: | + cd dask-gateway + python setup.py sdist + pip install wheel + python setup.py bdist_wheel + cd .. + - name: Check the sdist installs and imports + run: | + mkdir -p test-sdist + cd test-sdist + python -m venv venv-sdist + venv-sdist/bin/python -m pip install ../dask-gateway/dist/dask-gateway-*.tar.gz + venv-sdist/bin/python -c "import dask_gateway;print(dask_gateway.__version__)" + cd .. + - uses: actions/upload-artifact@v2 + with: + name: artifact_gateway + path: dask-gateway/dist/* + + build_gateway_server: + name: Build source distribution - dask-gateway-server + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-python@v2 + with: + python-version: "3.8" + - name: Build dask-gateway-server as an sdist and a bdist_wheel + run: | + cd dask-gateway-server + python setup.py sdist + pip install wheel + python build_tools/build_macos.py + python build_tools/build_manylinux.py + cd .. + - name: Check the sdist installs and imports + run: | + mkdir -p test-sdist + cd test-sdist + python -m venv venv-sdist + venv-sdist/bin/python -m pip install ../dask-gateway-server/dist/dask-gateway-server-*.tar.gz + venv-sdist/bin/python -c "import dask_gateway_server;print(dask_gateway_server.__version__)" + cd .. + - uses: actions/upload-artifact@v2 + with: + name: artifact_gateway_server + path: dask-gateway-server/dist/* + + upload_pypi: + name: Upload to PyPI on release - dask-gateway + needs: [build_gateway] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact_gateway + path: dask-gateway/dist + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_secret }} + + upload_pypi_server: + name: Upload to PyPI on release - dask-gateway-server + needs: [build_gateway_server] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact_gateway_server + path: dask-gateway-server/dist + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_secret }} From bdac36397ef57a55757259635eb752d6f32a1101 Mon Sep 17 00:00:00 2001 From: Shi Fan Date: Mon, 19 Oct 2020 12:24:37 -0400 Subject: [PATCH 2/3] Remove -it in docker subprocess --- dask-gateway-server/build_tools/build_manylinux.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dask-gateway-server/build_tools/build_manylinux.py b/dask-gateway-server/build_tools/build_manylinux.py index 5d778c98..4f0933da 100644 --- a/dask-gateway-server/build_tools/build_manylinux.py +++ b/dask-gateway-server/build_tools/build_manylinux.py @@ -42,7 +42,6 @@ def main(): [ "docker", "run", - "-it", "--rm", "--volume", "{}:/dist:rw".format(DIST_DIR), From e9bc5a065354b5ff9865519b7587b6da5908f9fb Mon Sep 17 00:00:00 2001 From: Shi Fan Date: Fri, 6 Nov 2020 16:25:56 -0500 Subject: [PATCH 3/3] Make workflow run on tags --- .github/workflows/pypi.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index deeac3bf..0f178879 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -4,10 +4,9 @@ on: branches: - master - auto-release + tags: ["*"] pull_request: branches: [master] - release: - types: [published] jobs: build_gateway: @@ -75,7 +74,7 @@ jobs: name: Upload to PyPI on release - dask-gateway needs: [build_gateway] runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' + if: github.tag != '' steps: - uses: actions/download-artifact@v2 with: @@ -90,7 +89,7 @@ jobs: name: Upload to PyPI on release - dask-gateway-server needs: [build_gateway_server] runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' + if: github.tag != '' steps: - uses: actions/download-artifact@v2 with: