From 0030272c6ecca29d0f51002172f8f749096d5943 Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Wed, 12 Jun 2019 17:12:01 -0600 Subject: [PATCH 1/2] Patch crate versions for linux/windows builds too --- .circleci/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02ceb54..bc12c1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,13 @@ jobs: - checkout - restore_cache: key: linux-{{ checksum "Cargo.lock" }} + - run: + name: patch crate version + command: | + version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') + sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml + + cargo update -p woodchipper - run: name: Build static linux x86_64 command: cargo build --release --locked @@ -44,6 +51,13 @@ jobs: rustup target add x86_64-pc-windows-gnu cat "misc/cargo-conf-mingw.toml" >> $CARGO_HOME/config + - run: + name: patch crate version + command: | + version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') + sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml + + cargo update -p woodchipper - run: name: Build windows x86_64 command: | From f7b5e91206a8af8b26290c51a930f23074ec4727 Mon Sep 17 00:00:00 2001 From: Tim Buckley Date: Wed, 12 Jun 2019 17:16:56 -0600 Subject: [PATCH 2/2] don't patch versions for PRs (duh) --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bc12c1f..bcd2e35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,10 +11,12 @@ jobs: - run: name: patch crate version command: | - version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') - sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml + if [[ -n "$CIRCLE_TAG" ]]; then + version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') + sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml - cargo update -p woodchipper + cargo update -p woodchipper + fi - run: name: Build static linux x86_64 command: cargo build --release --locked @@ -54,10 +56,12 @@ jobs: - run: name: patch crate version command: | - version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') - sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml + if [[ -n "$CIRCLE_TAG" ]]; then + version=$(echo "$CIRCLE_TAG" | sed -e 's/^v//') + sed -i -e "s/version = \"0.1.0\"/version = \"$version\"/" Cargo.toml - cargo update -p woodchipper + cargo update -p woodchipper + fi - run: name: Build windows x86_64 command: |