Skip to content

A peer-to-peer stack for code collaboration

Actually commit in release script.

Julian K. Arni189baaaa4619
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 49111ea..99ce060 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -95,13 +95,12 @@ jobs:
name: Package
command: |
set -euxo pipefail
-
- if [ "$CIRCLE_BRANCH" == "master" && "$CIRCLE_TAG" == v*]; then
- version="$TAG_NAME"
- VERSION=$version TARGET=darwin ./packaging/build-package.sh
+ TAG="$(git tag -l --points-at HEAD)"
+ if [[ "$TAG" == v* ]]; then
+ VERSION="$TAG" TARGET=darwin ./packaging/build-package.sh
# This is only set when building forked PRs
- if [ -n "$CIRCLE_PR_REPONAME" ]; then
+ if [ -n "${CIRCLE_PR_REPONAME-}" ]; then
echo "Skipping uploads for forks"
exit 0
fi
diff --git a/cloudbuild.yaml b/cloudbuild.yaml
index d9cf804..b2e402e 100644
--- a/cloudbuild.yaml
+++ b/cloudbuild.yaml
@@ -209,16 +209,16 @@ steps:
waitFor:
- "Integration tests"
name: $_BUILD_IMAGE
- env: ['STACK_ROOT=/workspace/.stack']
+ env:
+ - STACK_ROOT=/workspace/.stack
+ - TAG_NAME=$TAG_NAME
entrypoint: 'bash'
args:
- "-c"
- |
set -euxo pipefail
-
if [[ "$TAG_NAME" == v* ]]; then
- version="$TAG_NAME"
- VERSION=$version TARGET=debian ./packaging/build-package.sh
+ VERSION="$TAG_NAME" TARGET=debian ./packaging/build-package.sh
cp \
"packaging/out/radicle_${version}_amd64.deb" \
"packaging/out/radicle_latest_amd64.deb"
diff --git a/scripts/make-release.sh b/scripts/make-release.sh
index 2898478..c259b65 100755
--- a/scripts/make-release.sh
+++ b/scripts/make-release.sh
@@ -2,9 +2,12 @@
VERSION=$1
+set -o errexit
+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Bad version: $VERSION"
echo "Should have format 'x.y.z', where x, y and z are numbers"
+ exit 1
fi
if [ "$(git status --untracked-files=no --porcelain)" != " M ChangeLog.md" ]; then
@@ -15,10 +18,16 @@ fi
# Update package.yaml
mv package.yaml old-package.yaml
-sed "s/^version: '.*'$/version: '$VERSION'" old-package.yaml > package.yaml
+sed "s/^version: '.*'$/version: '$VERSION'/" old-package.yaml > package.yaml
rm old-package.yaml
-echo "git add package.yaml"
-echo "git add ChangeLog.md"
-echo "git commit -m \"Version update: $VERSION\""
-echo "git tag v$VERSION"
+# Update daemon-api.yaml
+mv docs/source/daemon-api.yaml old-daemon-api.yaml
+sed "s/^ version: .*$/ version: $VERSION/" old-daemon-api.yaml > docs/source/daemon-api.yaml
+rm old-daemon-api.yaml
+
+git add package.yaml
+git add ChangeLog.md
+git add docs/source/daemon-api.yaml
+git commit -m "Version update: $VERSION"
+git tag "v$VERSION"