Skip to content
Snippets Groups Projects
Unverified Commit 8cf194c2 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #634 from HumanBrainProject/chore_autoPublish

chore: auto tag releases
parents 52d6dbf1 3977b077
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,16 @@ jobs:
- 'echo GREP_VERSION_NUM: $GREP_VERSION_NUM'
- test -z "$GREP_VERSION_NUM" && exit 1 || exit 0
- stage: Create github release
if: |
type = push AND \
branch = master
before_script:
- chmod ugo+x ./release.sh
script: ./release.sh
env:
- secure: "mERkfztriSCECF/liheC4zFmq4h+MxausY8N0soTytOWUuTmz+NfxObsQ8w8Zl0h3XVe0BZdueJ15zeoipNBDisHZ2kbfLYnCJ8nsym+0O7mpYUSEiT5nDVE0Yj/9a+ZOAW0h0mvWNOwQZId0uTPr8rEst4IvCr+HkLZEUOM06lnftz1edYN3EsVih6MuTymXNLUaYkMBCErq2AFGvgOy6oP6Mq/D2QkBvM+RUNIxcJ2SrM9lMw4i5L/PeOnxbm0MBUndFhR/P0rJ7qz0j4kRP3DvgXfeW+hQsYcECGsnxMgC+Q59ULTBrRGuD03PnHI+7H8CrX+8maHYy+yf7S/iblaCcr0E5gZq/U0mUJbicymBhw4Ygu76X2Rj6E4jUeoC60MqDZovSisV6xuRXXFDqbfYxlBgFSsSS4Ozbl/RUA5MtLx/N4LwAKv5kafktFwZih/ZfQMAOZQfUDB60y4Mvh1Eg6XK4HhnRxdBE8GWP1tQLq/3n8NLr9KBIR4ceHUNEFXjWw3nPIAujnCqUoxSJotfDEnFUpV6KMgZxiC9vv/vq7IgnzzTXRGdvFfjzBbFmYv4+nqYzZhqKb7BI9y++0v+4Jdu9eHGdYVIpiYzzEKhqImK6I4CsUdcakXiPecdxlwA1zc/yET8qyBNGPGnXvYAw1hBt1VbtP8Rf3PKfo="
# Temporarily disabling browserstack e2e tests. They seem to fail without any reason
# - stage: browserstack e2e
......
......@@ -4,3 +4,7 @@
- Fixed matomo CSP issues
- Updated kg dataset previewer URL
# Under the hood
- CI/CD: auto tag releases on github
#! /bin/bash
# This is an automated script for TravisCI
# It is triggered on push to master
# It will create a release and publish to the github repo
OWNER=HumanBrainProject
REPO=interactive-viewer
USER=xgui3783
EMAIL=xgui3783@gmail.com
#GITHUB_TOKEN should be populated by CI
test -z "$GITHUB_TOKEN" && exit 1
TAG=$(jq '.version' < package.json)
TAG=${TAG#\"}
TAG=v${TAG%\"}
OBJECT=$(git rev-parse HEAD)
DATE=$(date --iso-8601=seconds)
BODY='{
"tag": "'$TAG'",
"message": "Annotated release for '$TAG'",
"object": "'$OBJECT'",
"type": "commit",
"tagger": {
"name": "'$USER'",
"email": "'$EMAIL'",
"date": "'$DATE'"
}
}'
# Create annotated tag
echo curl -XPOST \
-H "Accept: application/vnd.github.v3+json" \
-u "$USER:$GITHUB_TOKEN"\
-d "$BODY" \
https://api.github.com/repos/$OWNER/$REPO/git/tags
# Push tag to remote
CREATE_REF_BODY='{
"ref":"refs/tags/'$TAG'",
"sha":"'$OBJECT'"
}'
echo curl -XPOST\
-u "$USER:$GITHUB_TOKEN"\
-H "Accept: application/vnd.github.v3+json" \
-d "$CREATE_REF_BODY"\
https://api.github.com/repos/$OWNER/$REPO/git/refs
# Create release
RELEASE_NOTES=$(sed -e 's/$/\\n/' docs/releases/$TAG.md)
RELEASE_BODY='{
"tag_name":"'$TAG'",
"name":"'$TAG'",
"body":"'$(echo $RELEASE_NOTES)'",
"target_commitish": "master",
"draft":false,
"prerelease":false
}'
echo curl -XPOST\
-u "$USER:$GITHUB_TOKEN"\
-H "Accept: application/vnd.github.v3+json" \
-d "$RELEASE_BODY" \
https://api.github.com/repos/$OWNER/$REPO/releases
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment