This repository has been archived by the owner on Sep 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
/
release.sh
executable file
·44 lines (39 loc) · 1.85 KB
/
release.sh
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
#!/bin/bash -e
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Compiles the typescript sources to javascript and submits the files
# to the pypi server specified as first parameter, defaults to testpypi
# In order to run this script locally, make sure you have the following:
# - A Python 3 environment (due to urllib issues)
# - Typescript installed
# - A configured ~/.pypirc containing your pypi/testpypi credentials with
# the server names matching the name you're passing in. Do not include
# the repository URLs in the config file, this has been deprecated.
# - Make sure the package version string in the setup.py file is updated.
# It will get rejected by the server if it already exists
# - If this is a new release, make sure the release notes are updated
# and create a new release tag
tsc --module amd --noImplicitAny datalab/notebook/static/*.ts
tsc --module amd --noImplicitAny google/datalab/notebook/static/*.ts
# This is the test url, you should change this to
# https://upload.pypi.org/legacy/ for prod binaries
server="${1:-https://test.pypi.python.org/pypi}"
echo "Submitting package to ${server}"
# Build and upload a distribution package
rm -rf dist/*
python setup.py sdist
twine upload --repository-url "${server}" dist/*
# Clean up
rm -f datalab/notebook/static/*.js
rm -f google/datalab/notebook/static/*.js