-
-
Notifications
You must be signed in to change notification settings - Fork 149
73 lines (60 loc) · 2.52 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Package
on: [push, pull_request]
jobs:
build-distribution:
runs-on: "ubuntu-latest"
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install pypa/build and chartpress
run: python -m pip install build wheel chartpress pyyaml
# chartpress pushes a packages Helm chart to dask/helm-chart's gh-pages
# branch, so we need to have a git user.email and user.name configured
- name: Configure a git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions user"
- name: Build distributions
shell: bash -l {0}
run: python setup.py sdist bdist_wheel
- name: Publish package to PyPI
if: github.repository == 'dask/dask-kubernetes' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Get the version
id: get_version
run: |
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
else
echo ::set-output name=VERSION::dev
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: github.repository == 'dask/dask-kubernetes' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish operator Helm chart with chartpress
env:
# chartpress can make use of a personal access token by setting these
# environment variables like this, for details see:
# https://github.com/jupyterhub/chartpress/blob/d4e2346d50f0724f6bee387f4f8aebc108afb648/chartpress.py#L118-L128
#
GITHUB_ACTOR: ""
GITHUB_TOKEN: "${{ secrets.dask_bot_token }}"
PUBLISH: ${{ github.repository == 'dask/dask-kubernetes' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
run: |
cd dask_kubernetes/operator/deployment/helm
if ${PUBLISH} == true; then
chartpress --force-push --force-publish-chart
else
chartpress
fi