diff --git a/.travis.yml b/.travis.yml index 94b22d2c2..718001146 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,68 +54,24 @@ jobs: - name: crates.io, NPM and GitHub stage: release - if: (tag IS present) AND (tag =~ ^medea-[a-z-]*[0-9]+\.[0-9]+\.[0-9]+) + if: (tag IS present) AND (tag =~ ^medea[a-z-]*-[0-9]+\.[0-9]+\.[0-9]+) cache: false - script: echo "Releasing $TRAVIS_TAG..." + before_script: + - export MEDEA_CRATE_NAME=$(echo $TRAVIS_TAG \ + | sed -E "s/^(medea[a-z-]*)-[0-9]+\.[0-9]+\.[0-9]+/\1/") + script: + - cargo clean -p $MEDEA_CRATE_NAME before_deploy: - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh deploy: - provider: script skip_cleanup: true - script: make release.crates crate=medea publish=yes - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-[0-9]+\.[0-9]+\.[0-9]+ - - provider: releases - skip_cleanup: true - api_key: $GH_TOKEN - name: $TRAVIS_TAG - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-[0-9]+\.[0-9]+\.[0-9]+ - - - provider: script - skip_cleanup: true - script: make release crate=medea-jason publish=yes - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-jason-[0-9]+\.[0-9]+\.[0-9]+ - - provider: releases - skip_cleanup: true - api_key: $GH_TOKEN - name: $TRAVIS_TAG - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-jason-[0-9]+\.[0-9]+\.[0-9]+ - - - provider: script - skip_cleanup: true - script: make release.crates crate=medea-client-api-proto publish=yes - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-client-api-proto-[0-9]+\.[0-9]+\.[0-9]+ - - provider: releases - skip_cleanup: true - api_key: $GH_TOKEN - name: $TRAVIS_TAG - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-client-api-proto-[0-9]+\.[0-9]+\.[0-9]+ - - - provider: script - skip_cleanup: true - script: make release.crates crate=medea-macro publish=yes - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-macro-[0-9]+\.[0-9]+\.[0-9]+ + script: make release crate=$MEDEA_CRATE_NAME publish=yes - provider: releases skip_cleanup: true api_key: $GH_TOKEN name: $TRAVIS_TAG - on: - tags: true - condition: $TRAVIS_TAG =~ ^medea-macro-[0-9]+\.[0-9]+\.[0-9]+ notifications: email: diff --git a/Cargo.lock b/Cargo.lock index 8b3d29751..8260a17bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1117,8 +1117,8 @@ dependencies = [ "hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "macro-attr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "medea-client-api-proto 0.1.0-dev", - "medea-macro 0.1.0", + "medea-client-api-proto 0.1.0", + "medea-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "newtype_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "redis 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1142,9 +1142,9 @@ dependencies = [ [[package]] name = "medea-client-api-proto" -version = "0.1.0-dev" +version = "0.1.0" dependencies = [ - "medea-macro 0.1.0", + "medea-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1157,8 +1157,8 @@ dependencies = [ "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "js-sys 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)", "macro-attr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "medea-client-api-proto 0.1.0-dev", - "medea-macro 0.1.0", + "medea-client-api-proto 0.1.0", + "medea-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "newtype_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1179,6 +1179,17 @@ dependencies = [ "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "medea-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "memchr" version = "0.1.11" @@ -2746,6 +2757,7 @@ dependencies = [ "checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" "checksum macro-attr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00e51c6f0e2bf862b01b3d784fc32b02feb248a69062c51fb0b6d14cd526cc2a" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum medea-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70a1d5121ec38c5f20762b4c4e422c755337a0063ecfc26aa51b4e4ed9936c2f" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" diff --git a/Cargo.toml b/Cargo.toml index aa705614d..b294938b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ hashbrown = "0.1" humantime = "1.2" macro-attr = "0.2" medea-client-api-proto = { path = "proto/client-api", features = ["medea"] } -medea-macro = { path = "crates/medea-macro" } +medea-macro = "0.1" newtype_derive = "0.1" rand = "0.7" redis = "0.10" diff --git a/Makefile b/Makefile index 91890aa8e..880bc0509 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,17 @@ RUST_VER := 1.36 CURRENT_BRANCH := $(strip $(shell git branch | grep \* | cut -d ' ' -f2)) +crate-dir = . +ifeq ($(crate),medea-jason) +crate-dir = jason +endif +ifeq ($(crate),medea-client-api-proto) +crate-dir = proto/client-api +endif +ifeq ($(crate),medea-macro) +crate-dir = crates/medea-macro +endif + @@ -217,6 +228,7 @@ ifeq ($(test-unit-crate),@all) @make test.unit crate=medea-jason @make test.unit crate=medea else + cd $(crate-dir)/ && \ cargo test -p $(test-unit-crate) endif @@ -235,25 +247,14 @@ endif # [publish=(no|yes)] release-crates-token = $(if $(call eq,$(token),),${CARGO_TOKEN},$(token)) -release-crates-dir = $(error No crate '$(crate)' exists) -ifeq ($(crate),medea) -release-crates-dir = -endif -ifeq ($(crate),medea-jason) -release-crates-dir = jason -endif -ifeq ($(crate),medea-client-api-proto) -release-crates-dir = proto/client-api -endif -ifeq ($(crate),medea-macro) -release-crates-dir = crates/medea-macro -endif release.crates: - cd $(release-crates-dir)/ && \ +ifneq ($(filter $(crate),medea medea-jason medea-client-api-proto medea-macro),) + cd $(crate-dir)/ && \ $(if $(call eq,$(publish),yes),\ cargo publish --token $(release-crates-token) ,\ cargo package --allow-dirty ) +endif release.helm: helm.package.release @@ -262,20 +263,16 @@ release.helm: helm.package.release # Build and publish project crate to NPM. # # Usage: -# make release.npm [crate=medea-jason] +# make release.npm crate=medea-jason # [publish=(no|yes)] -release-npm-crate = $(if $(call eq,$(crate),),medea-jason,$(crate)) -release-npm-dir = $(error No NPM crate '$(release-npm-crate)' exists) -ifeq ($(release-npm-crate),medea-jason) -release-npm-dir = jason -endif - release.npm: - @rm -rf $(release-npm-dir)/pkg/ - wasm-pack build -t web $(release-npm-dir)/ +ifneq ($(filter $(crate),medea-jason),) + @rm -rf $(crate-dir)/pkg/ + wasm-pack build -t web $(crate-dir)/ ifeq ($(publish),yes) - wasm-pack publish $(release-npm-dir)/ + wasm-pack publish $(crate-dir)/ +endif endif diff --git a/jason/Cargo.toml b/jason/Cargo.toml index 26be96fd1..4cdb7d634 100644 --- a/jason/Cargo.toml +++ b/jason/Cargo.toml @@ -27,7 +27,7 @@ futures = "0.1" js-sys = "0.3" macro-attr = "0.2" medea-client-api-proto = { path = "../proto/client-api", features = ["jason"] } -medea-macro = { path = "../crates/medea-macro" } +medea-macro = "0.1" newtype_derive = "0.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/proto/client-api/CHANGELOG.md b/proto/client-api/CHANGELOG.md index abca7a177..b95b7bf90 100644 --- a/proto/client-api/CHANGELOG.md +++ b/proto/client-api/CHANGELOG.md @@ -6,7 +6,7 @@ All user visible changes to this project will be documented in this file. This p -## TBD [0.1.0] · 2019-08-?? +## [0.1.0] · 2019-08-21 [0.1.0]: /../../tree/medea-client-api-proto-0.1.0/proto/client-api [Milestone](/../../milestone/1) | [Roadmap](/../../issues/8) diff --git a/proto/client-api/Cargo.toml b/proto/client-api/Cargo.toml index 5466cef6d..6d62996f0 100644 --- a/proto/client-api/Cargo.toml +++ b/proto/client-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "medea-client-api-proto" -version = "0.1.0-dev" +version = "0.1.0" edition = "2018" description = "Client API protocol implementation for Medea media server" authors = ["Instrumentisto Team "] @@ -18,6 +18,6 @@ jason = [] medea = [] [dependencies] -medea-macro = { path = "../../crates/medea-macro" } +medea-macro = "0.1" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0"