This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 47
235 lines (225 loc) 路 6.89 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
name: Release
on:
push:
tags:
- '*'
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
defaults:
run:
shell: bash -l {0}
jobs:
integrity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build checksum file
run: |
sed -n 17,146p .github/workflows/build.yml > build
sed -n 17,146p .github/workflows/release.yml > release
diff build release
test:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install jupyter_packaging
- name: Install the package
run: |
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-classic/lab-extension.*enabled.*ok" -
jupyter server extension list 2>&1 | grep -ie "jupyterlab_classic.*enabled" -
python -m jupyterlab.browser_check
- name: Lint
run: |
jlpm
jlpm run eslint:check
jlpm run prettier:check
- name: Test
run: |
jlpm run build:test
jlpm run test
build:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
- name: Build pypi distributions
run: |
python setup.py sdist bdist_wheel
- name: Build npm distributions
run: |
mkdir pkgs
jlpm lerna exec -- npm pack
cp packages/*/*.tgz pkgs
- name: Build checksum file
run: |
cd dist
sha256sum * | tee SHA256SUMS
cd ../pkgs
sha256sum * | tee SHA256SUMS
- name: Upload distributions
uses: actions/upload-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Upload distributions
uses: actions/upload-artifact@v2
with:
name: pkgs ${{ github.run_number }}
path: ./pkgs
install:
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.6', '3.9']
include:
- python: '3.6'
dist: 'jupyterlab-classic*.tar.gz'
- python: '3.9'
dist: 'jupyterlab_classic*.whl'
- os: windows
py_cmd: python
- os: macos
py_cmd: python3
- os: ubuntu
py_cmd: python
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: |
${{ matrix.py_cmd }} -m pip install pip wheel
- name: Install the package
run: |
cd dist
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
- name: Validate environment
run: |
${{ matrix.py_cmd }} -m pip freeze
${{ matrix.py_cmd }} -m pip check
- name: Validate the install
run: |
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@jupyterlab-classic/lab-extension.*enabled.*ok" -
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "jupyterlab_classic.*enabled" -
jupyter classic --version
jupyter classic --help
release:
if: startsWith(github.ref, 'refs/tags/')
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Cleanup dist
run: |
rm dist/SHA256SUMS
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.7.9 pip
jlpm
jlpm run build
- uses: actions/download-artifact@v2
with:
name: pkgs ${{ github.run_number }}
path: ./pkgs
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
jlpm config set registry https://registry.npmjs.org
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
cp ~/.npmrc .npmrc
jlpm release:npm --dist ./pkgs
- name: Get the current tag
id: current_tag
run: |
tag=`git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1)`
echo "::set-output name=tag::${tag}"
- name: Get the previous tag
id: previous_tag
run: |
tag=`git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)`
echo "::set-output name=tag::${tag}"
- name: Generate Changelog
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.CHANGELOG_GITHUB_TOKEN }}
run: |
docker run --rm -v "$(pwd)":/usr/local/src/your-app \
-e CHANGELOG_GITHUB_TOKEN=${CHANGELOG_GITHUB_TOKEN} \
ferrarimarco/github-changelog-generator \
github_changelog_generator -u jtpio -p jupyterlab-classic --usernames-as-github-logins --no-issues --no-unreleased \
--since-tag ${{ steps.previous_tag.outputs.tag }} --header "" --pr-label "## Changes"
head -n -1 CHANGELOG.md > CHANGELOG
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: CHANGELOG
# TODO: set to false?
draft: true
prerelease: ${{ contains(github.ref, 'a') || contains(github.ref, 'b') || contains(github.ref, 'rc') }}