-
-
Notifications
You must be signed in to change notification settings - Fork 404
160 lines (153 loc) · 4.62 KB
/
build.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: packages
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+b[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
# Dry-run only
workflow_dispatch:
schedule:
- cron: '0 14 * * SUN'
env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
PYTHON_VERSION: "3.10"
PACKAGE: "holoviews"
jobs:
conda_build:
name: Build Conda Package
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash -el {0}
outputs:
conda_file: ${{ env.CONDA_FILE }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
fetch-tags: true
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: conda setup
run: |
# pyct is for running setup.py
conda install -y conda-build build pyct -c pyviz/label/dev
- name: conda build
run: |
source ./scripts/build_conda.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
if: always()
with:
name: conda_build
path: ${{ env.CONDA_FILE }}
if-no-files-found: error
conda_publish:
name: Publish Conda Package
runs-on: ubuntu-latest
needs: [conda_build, waiting_room]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
CONDA_UPLOAD_TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }}
defaults:
run:
shell: bash -el {0}
steps:
- name: Set environment variables
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "CONDA_FILE=${{ needs.conda_build.outputs.conda_file }}" >> $GITHUB_ENV
- name: Check environment variables
run: |
echo $TAG $CONDA_FILE
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: conda setup
run: |
conda install -y anaconda-client
- uses: actions/download-artifact@v3
with:
name: conda_build
path: ${{ env.CONDA_FILE }}
- name: conda dev upload
if: contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')
run: |
anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev ${{ env.CONDA_FILE }}
- name: conda main upload
if: (!(contains(env.TAG, 'a') || contains(env.TAG, 'b') || contains(env.TAG, 'rc')))
run: |
# anaconda --token $CONDA_UPLOAD_TOKEN upload --user pyviz --label=dev --label=main ${{ env.CONDA_FILE }}
echo conda main upload
pip_build:
name: Build PyPI Package
runs-on: 'ubuntu-latest'
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
fetch-tags: true
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install build
run: |
python -m pip install build
- name: Build package
run: python -m build .
- uses: actions/upload-artifact@v3
if: always()
with:
name: pip_build
path: dist/
if-no-files-found: error
pip_install:
name: Install PyPI Package
runs-on: 'ubuntu-latest'
needs: [pip_build]
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/download-artifact@v3
with:
name: pip_build
path: dist/
- name: Install package
run: python -m pip install dist/*.whl
- name: Test package
run: python -c "import $PACKAGE"
pip_publish:
name: Publish PyPI Package
runs-on: ubuntu-latest
needs: [pip_build, waiting_room]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: pip_build
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PPU }}
password: ${{ secrets.PPP }}
repository-url: "https://upload.pypi.org/legacy/"
waiting_room:
name: Waiting Room
runs-on: ubuntu-latest
needs: [conda_build, pip_install]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
environment:
name: publish
steps:
- run: echo "All builds have finished, have been approved, and ready to publish"