Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test GitHub Actions for auto-release #339

Merged
merged 3 commits into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: PyPI
on:
push:
branches:
- master
- auto-release
Comment on lines +3 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this to run on every merge to master? And what is the auto-release branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto-release is a branch I made in my fork. I was testing the feasibility of this auto-release workflow, so made it run on every merge to master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sure. That will need removing before merging though.

tags: ["*"]
pull_request:
branches: [master]
fanshi118 marked this conversation as resolved.
Show resolved Hide resolved

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.tag != ''
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.tag != ''
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 }}
1 change: 0 additions & 1 deletion dask-gateway-server/build_tools/build_manylinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def main():
[
"docker",
"run",
"-it",
"--rm",
"--volume",
"{}:/dist:rw".format(DIST_DIR),
Expand Down