Skip to content

Commit

Permalink
Automate release.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamalkm committed Apr 14, 2020
1 parent b6adb0a commit 28576e2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@ dist: trusty
sudo: required
language: bash

branches:
only:
- master

stages:
- Build
- Release
- name: Build and Release

jobs:
include:
- stage: Build
name: "Build zip distribution"
script:
- stage: "Build and Release"
name: "Build and release alfresco-keycloak-theme"
if: fork = false AND (branch = master) AND type != pull_request AND commit_message !~ /\[no-release\]/
before_deploy:
- ./set-version.sh
- source build.properties
- echo "Prepare deployment of alfresco-keycloak-theme-$THEME_VERSION"
- ./build.sh
- stage: Release
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: "alfresco-keycloak-theme-$TRAVIS_TAG.zip"
file: "alfresco-keycloak-theme-$THEME_VERSION.zip"
skip_cleanup: true
edge: true
on:
Expand Down
2 changes: 1 addition & 1 deletion build.properties
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
THEME_VERSION=0.2
THEME_VERSION=0.1
22 changes: 0 additions & 22 deletions release.sh

This file was deleted.

16 changes: 16 additions & 0 deletions set-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

OLD_VERSION=$(cat build.properties | grep THEME_VERSION)
OLD_VALUE=$(echo $OLD_VERSION | cut -f 2 -d "=")

NEW_VALUE=$(echo $OLD_VALUE + .1 | bc)

if [[ $NEW_VALUE == .* ]]; then
# Append zero
NEW_VALUE="0$NEW_VALUE"
fi

echo "Setting the THEME_VERSION from '$OLD_VALUE' to '$NEW_VALUE'"

NEW_VERSION=$(echo THEME_VERSION=$NEW_VALUE)
sed -i -e "s/$OLD_VERSION/$NEW_VERSION/" build.properties

0 comments on commit 28576e2

Please sign in to comment.