mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(travis): release process finalized
This commit is contained in:
@@ -83,6 +83,10 @@ function run {
|
||||
--action="github" \
|
||||
--version=$VERSION \
|
||||
--old-version=$OLD_VERSION
|
||||
./scripts/travis/release-new-version.sh \
|
||||
--action="discourse" \
|
||||
--version=$VERSION \
|
||||
--old-version=$OLD_VERSION
|
||||
|
||||
# Version name used on the CDN/docs: nightly or the version
|
||||
VERSION_NAME=$VERSION
|
||||
@@ -91,6 +95,8 @@ function run {
|
||||
./scripts/site/publish.sh --action="updateConfig"
|
||||
./scripts/seed/publish.sh --version="$VERSION"
|
||||
./scripts/app-base/publish.sh --version="$VERSION"
|
||||
|
||||
gulp release-tweet release-irc
|
||||
else
|
||||
./scripts/site/publish.sh --action="clone"
|
||||
|
||||
|
||||
@@ -56,26 +56,26 @@ function push {
|
||||
git push -q $RELEASE_REMOTE v$VERSION
|
||||
|
||||
echo "-- v$VERSION \"$CODENAME\" pushed to $RELEASE_REMOTE/master successfully!"
|
||||
gulp release-tweet release-irc
|
||||
}
|
||||
|
||||
function github {
|
||||
echo "-- Pushing out github release..."
|
||||
|
||||
# Get only newest things in changelog - sed until previous version is hit
|
||||
sed -e '/'"$OLD_VERSION"'/,$d' $PROJECT_DIR/CHANGELOG.md | tail -n +3 \
|
||||
> $TMP_DIR/CHANGELOG_NEW.md
|
||||
|
||||
CODENAME=$(readJsonProp "$PROJECT_DIR/package.json" "codename")
|
||||
|
||||
# we have to get all releases, then find the one corresponding to this new tag
|
||||
curl https://api.github.com/repos/$GH_ORG/ionic/releases > $TMP_DIR/releases.json
|
||||
|
||||
node -e "var releases = require('$TMP_DIR/releases.json'); \
|
||||
var release; \
|
||||
releases.forEach(function(r) { \
|
||||
if (r.tag_name == 'v$VERSION') { \
|
||||
release = r.id; \
|
||||
require('fs').writeFileSync('$TMP_DIR/RELEASE_ID', r.id); \
|
||||
} \
|
||||
}); \
|
||||
require('fs').writeFileSync('$TMP_DIR/RELEASE_ID', release);"
|
||||
});"
|
||||
RELEASE_ID=$(cat $TMP_DIR/RELEASE_ID)
|
||||
|
||||
node -e "require('fs').writeFileSync('$TMP_DIR/github.json', JSON.stringify({ \
|
||||
@@ -86,10 +86,48 @@ function github {
|
||||
curl -X PATCH https://api.github.com/repos/$GH_ORG/ionic/releases/$RELEASE_ID \
|
||||
-H "Authorization: token $GH_TOKEN" \
|
||||
--data-binary @$TMP_DIR/github.json
|
||||
|
||||
echo "-- Github release pushed out successfully!"
|
||||
}
|
||||
|
||||
function discourse {
|
||||
|
||||
CODENAME=$(readJsonProp "$PROJECT_DIR/package.json" "codename")
|
||||
# Get only newest things in changelog - sed until previous version is hit
|
||||
sed -e '/'"$OLD_VERSION"'/,$d' $PROJECT_DIR/CHANGELOG.md | tail -n +3 \
|
||||
> $TMP_DIR/NEW_CHANGELOG.md
|
||||
|
||||
node -e "var fs=require('fs'); \
|
||||
fs.writeFileSync('$TMP_DIR/discourse.json', \
|
||||
\"api_key=$DISCOURSE_TOKEN\" + \
|
||||
\"&api_username=Ionitron\" + \
|
||||
\"&title=\" + encodeURIComponent(\"v$VERSION '$CODENAME' Released!\") + \
|
||||
\"&raw=\" + encodeURIComponent(\"Download Instructions: https://github.com/driftyco/ionic#quick-start\n\n\" + fs.readFileSync('$TMP_DIR/CHANGELOG_NEW.md').toString()) \
|
||||
)";
|
||||
|
||||
curl -X POST http://forum.ionicframework.com/posts \
|
||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||
--data-binary @$TMP_DIR/discourse.json \
|
||||
> $TMP_DIR/discourse-response.json
|
||||
|
||||
touch $IONIC_DIR/config/RELEASE_POST_URL
|
||||
OLD_POST_URL=$(cat $IONIC_DIR/config/RELEASE_POST_URL)
|
||||
if [[ "$OLD_POST_URL" != "" ]]; then
|
||||
curl -X PUT "$OLD_POST_URL/status" --data "api_key=$DISCOURSE_TOKEN&api_username=Ionitron&status=pinned&enabled=false"
|
||||
fi
|
||||
|
||||
POST_URL=`node -e "var res = require('$TMP_DIR/discourse-response.json'); \
|
||||
console.log(\"http://forum.ionicframework.com/t/\" + res.topic_slug + \"/\" + res.topic_id);"`
|
||||
echo $POST_URL > $IONIC_DIR/config/RELEASE_POST_URL
|
||||
|
||||
curl -X PUT "$POST_URL/status" \
|
||||
--data "api_key=$DISCOURSE_TOKEN&api_username=Ionitron&status=pinned&enabled=true"
|
||||
curl -X PUT "$POST_URL/status" \
|
||||
--data "api_key=$DISCOURSE_TOKEN&api_username=Ionitron&status=closed&enabled=true"
|
||||
|
||||
cd $IONIC_DIR
|
||||
git add config
|
||||
git commit config -m 'chore(release): update discourse post url'
|
||||
git push -q origin master
|
||||
}
|
||||
|
||||
source $(dirname $0)/../utils.inc
|
||||
|
||||
Reference in New Issue
Block a user