Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit a3e8f88

Browse files
committed
better script release
1 parent 5f98c8b commit a3e8f88

File tree

2 files changed

+70
-4
lines changed

2 files changed

+70
-4
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,20 @@ jobs:
6363
- ./scripts/build.sh || exit 1
6464
- ./scripts/publish.sh
6565

66-
- stage: Release beta tag
66+
- stage: Release Tag
6767
if: branch = master AND type = push OR (tag =~ .*beta.*)
6868
script: ./scripts/git-tag.sh
6969

70-
- stage: trigger ADF
71-
name: trigger ADF
72-
if: (branch = master OR branch = development OR (tag =~ .*beta.*)) AND type = push
70+
- stage: Trigger ADF
71+
name: Trigger ADF
72+
if: (branch = development OR (tag =~ .*beta.*)) AND type = push
7373
script: ./scripts/trigger-travis.sh --branch $TRAVIS_BRANCH Alfresco alfresco-ng2-components $TRAVIS_ACCESS_TOKEN
7474

75+
- stage: Update Released Version ADF
76+
name: Update Released Version ADF
77+
if: branch = master AND type = push
78+
script: ./scripts/travis/update/update-project.sh -gnu -t $GITHUB_TOKEN -n 'Alfresco/alfresco-ng2-components' -vjs $JS_VERSION
79+
7580
cache:
7681
directories:
7782
- dist

scripts/update-project.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
TEMP_GENERATOR_DIR=".tmp-generator";
5+
VERSION=$(npm view @alfresco/adf-core@beta version)
6+
JS_VERSION=$(npm view @alfresco/js-api@beta version)
7+
8+
show_help() {
9+
echo "Usage: update-project.sh"
10+
echo ""
11+
echo "-t or --token Github ouath token"
12+
echo "-n or --name Github name of the project"
13+
echo "-v or --version ADF version if not passed will use the beta"
14+
echo "-vjs or --vjs JS API version if not passed will use the beta"
15+
}
16+
17+
token() {
18+
TOKEN=$1
19+
}
20+
21+
vjs() {
22+
JS_VERSION=$1
23+
}
24+
25+
version() {
26+
VERSION=$1
27+
}
28+
29+
name_repo() {
30+
NAME_REPO=$1
31+
}
32+
33+
while [[ $1 == -* ]]; do
34+
case "$1" in
35+
-h|--help|-\?) show_help; exit 0;;
36+
-n|--name|-\?) name_repo $2; shift 2;;
37+
-t|--token) token $2; shift 2;;
38+
-v|--version) version $2; shift 2;;
39+
-vjs|--vjs) vjs $2; shift 2;;
40+
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
41+
esac
42+
done
43+
44+
rm -rf $TEMP_GENERATOR_DIR;
45+
46+
git clone https://$TOKEN@github.com/$NAME_REPO.git $TEMP_GENERATOR_DIR
47+
cd $TEMP_GENERATOR_DIR
48+
git checkout development
49+
50+
BRANCH="JS-API-Update-$VERSION"
51+
git checkout -b $BRANCH
52+
53+
./scripts/update-version.sh -gnu -v $VERSION -vj $JS_VERSION
54+
55+
git add .
56+
git commit -m "Update JS-API packages version $VERSION"
57+
git push -u origin $BRANCH
58+
59+
curl -H "Authorization: token $TOKEN" -X POST -d '{"body":"Update JS-API packages version '$VERSION'","head":"'$BRANCH'","base":"development","title":"Update JS-API packages version '$VERSION'"}' https://api.github.com/repos/$NAME_REPO/pulls
60+
61+
rm -rf $TEMP_GENERATOR_DIR;

0 commit comments

Comments
 (0)