Skip to content

Commit

Permalink
Merge branch 'dm/new-publish-workflow' into 'master'
Browse files Browse the repository at this point in the history
dm/new-publish-workflow

See merge request Tanker/sdk-js!13
  • Loading branch information
Alois committed Oct 12, 2018
2 parents 4531448 + 2390635 commit 31adca2
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unidecode = "*"
python-cli-ui = "*"
"path.py" = "*"
requests = "*"
tbump = ">= 5.0.0"
tbump = "==5.0.1"
websockets = "*"
psutil = "*"
pipenv = "==2018.05.18"
Expand Down
2 changes: 1 addition & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions ci/deploy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import argparse

import path
from path import Path
import re
import tbump
import tbump.config

import ci
Expand All @@ -10,7 +11,7 @@

def get_package_path(package_name):
m = re.match(r"^@tanker/(datastore-)?(.*)$", package_name)
p = path.Path("packages")
p = Path("packages")
if m[1]:
p = p.joinpath("datastore")
return p.joinpath(m[2]).joinpath("dist")
Expand All @@ -27,7 +28,7 @@ def version_to_npm_tag(version):
def version_from_git_tag(git_tag):
prefix = "v"
assert git_tag.startswith(prefix), "tag should start with %s" % prefix
tbump_cfg = tbump.config.parse(path.Path("tbump.toml"))
tbump_cfg = tbump.config.parse(Path("tbump.toml"))
regex = tbump_cfg.version_regex
version = git_tag[len(prefix):]
match = regex.match(version)
Expand All @@ -41,9 +42,12 @@ def publish_npm_package(package_name, version):
ci.run("npm", "publish", "--access", "public", "--tag", npm_tag, cwd=package_path)



def deploy_sdk(env, git_tag):
version = version_from_git_tag(git_tag)

tbump.bump_files(version)

# Publish packages in order so that dependencies don't break during deploy
configs = [
{ "build": "crypto", "publish": ["@tanker/crypto"] },
Expand All @@ -63,7 +67,7 @@ def deploy_sdk(env, git_tag):
]

for config in configs:
ci.yarn_build(config["build"], env)
ci.yarn_build(delivery=config["build"], env=env)
for package_name in config["publish"]:
publish_npm_package(package_name, version)

Expand Down
6 changes: 3 additions & 3 deletions packages/client-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@tanker/client-browser",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"description": "Tanker client SDK for web browsers",
"author": "Tanker Team",
"license": "Apache-2.0",
"main": "src/index.js",
"dependencies": {
"@tanker/core": "1.8.1-alpha16",
"@tanker/datastore-dexie-browser": "1.8.1-alpha16"
"@tanker/core": "0.0.1",
"@tanker/datastore-dexie-browser": "0.0.1"
}
}
8 changes: 4 additions & 4 deletions packages/client-node/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@tanker/client-node",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"description": "Tanker client SDK for Node.js command line applications",
"author": "Tanker Team",
"license": "Apache-2.0",
"main": "src/index.js",
"dependencies": {
"@tanker/core": "1.8.1-alpha16",
"@tanker/datastore-pouchdb-node": "1.8.1-alpha16"
"@tanker/core": "0.0.1",
"@tanker/datastore-pouchdb-node": "0.0.1"
},
"devDependencies": {
"@tanker/datastore-pouchdb-memory": "1.8.1-alpha16"
"@tanker/datastore-pouchdb-memory": "0.0.1"
}
}
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanker/core",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"description": "Tanker Core SDK",
"author": "Tanker Team",
"license": "Apache-2.0",
Expand All @@ -12,9 +12,9 @@
},
"dependencies": {
"@babel/runtime-corejs2": "7.0.0",
"@tanker/crypto": "1.8.1-alpha16",
"@tanker/datastore-base": "1.8.1-alpha16",
"@tanker/datastore-pouchdb-memory": "1.8.1-alpha16",
"@tanker/crypto": "0.0.1",
"@tanker/datastore-base": "0.0.1",
"@tanker/datastore-pouchdb-memory": "0.0.1",
"array-find": "^1.0.0",
"array.chunk": "^1.1.0",
"async-mutex": "^0.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// @flow
export const TANKER_SDK_VERSION = '1.8.1-alpha16';
export const TANKER_SDK_VERSION = '0.0.1';
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanker/crypto",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"description": "Cryptographic primitives used by the Tanker SDK",
"main": "src/index.js",
"module": "es.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/datastore/base/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@tanker/datastore-base",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"browser": "browser.js",
"dependencies": {
"@tanker/crypto": "1.8.1-alpha16"
"@tanker/crypto": "0.0.1"
},
"devDependencies": {
"chai": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/datastore/dexie-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@tanker/datastore-dexie-browser",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"browser": "browser.js",
"dependencies": {
"dexie": "^2.0.4",
"@tanker/crypto": "1.8.1-alpha16"
"@tanker/crypto": "0.0.1"
},
"devDependencies": {
"@tanker/datastore-tests": "0.0.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/datastore/mongodb/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@tanker/datastore-mongodb",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"dependencies": {
"@tanker/datastore-base": "1.8.1-alpha16",
"@tanker/datastore-base": "0.0.1",
"mongodb": "^3.1.4"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/datastore/pouchdb-base/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@tanker/datastore-pouchdb-base",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"browser": "browser.js",
"dependencies": {
"@tanker/datastore-base": "1.8.1-alpha16"
"@tanker/datastore-base": "0.0.1"
}
}
4 changes: 2 additions & 2 deletions packages/datastore/pouchdb-memory/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@tanker/datastore-pouchdb-memory",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"browser": "browser.js",
"dependencies": {
"@tanker/datastore-pouchdb-base": "1.8.1-alpha16",
"@tanker/datastore-pouchdb-base": "0.0.1",
"pouchdb-adapter-leveldb": "^6.4.3",
"pouchdb-core": "^6.4.3",
"pouchdb-find": "^6.4.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/datastore/pouchdb-node/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@tanker/datastore-pouchdb-node",
"version": "1.8.1-alpha16",
"version": "0.0.1",
"license": "Apache-2.0",
"main": "src/index.js",
"module": "es.js",
"browser": "browser.js",
"dependencies": {
"@tanker/datastore-pouchdb-base": "1.8.1-alpha16",
"@tanker/datastore-pouchdb-base": "0.0.1",
"pouchdb-adapter-leveldb": "^6.4.3",
"pouchdb-core": "^6.4.3",
"pouchdb-find": "^6.4.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/datastore/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"dependencies": {
"chai": "^4.1.0",
"chai-as-promised": "^7.1.1",
"@tanker/datastore-base": "1.8.1-alpha16"
"@tanker/datastore-base": "0.0.1"
}
}
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[version]
current = "1.8.1-alpha16"
current = "0.0.1"
regex = '''
(?P<major>\d+)
\.
Expand Down

0 comments on commit 31adca2

Please sign in to comment.