Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Create 0.1.0 release of 'medea-client-api-proto' crate
Browse files Browse the repository at this point in the history
Additionally:
- improve releasing commands in Makefile
- fix 'test.unit' Makefile command to work in situation when multiple versions of smae crate available in Cargo workspace
- simplify Travis CI pipeline
  • Loading branch information
tyranron committed Aug 21, 2019
1 parent 84a1366 commit 7432f56
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 82 deletions.
55 changes: 8 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,68 +54,29 @@ 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
- echo "Releasing $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
script: make release crate=$MEDEA_CRATE_NAME publish=yes
on:
tags: true
condition: $TRAVIS_TAG =~ ^medea-macro-[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-macro-[0-9]+\.[0-9]+\.[0-9]+

notifications:
email:
Expand Down
24 changes: 18 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
45 changes: 21 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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




Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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


Expand Down
2 changes: 1 addition & 1 deletion jason/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion proto/client-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions proto/client-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
Expand All @@ -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"

0 comments on commit 7432f56

Please sign in to comment.