Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bpresles
Cesium
Commits
5aa9cbb2
Commit
5aa9cbb2
authored
8 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
New script to upload assets to github
parent
10bc2f7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
github.sh
+76
-0
76 additions, 0 deletions
github.sh
release.sh
+5
-2
5 additions, 2 deletions
release.sh
www/js/config.js
+2
-2
2 additions, 2 deletions
www/js/config.js
with
83 additions
and
4 deletions
github.sh
0 → 100755
+
76
−
0
View file @
5aa9cbb2
#!/bin/bash
### Control that the script is run on `dev` branch
branch
=
`
git rev-parse
--abbrev-ref
HEAD
`
if
[[
!
"
$branch
"
=
"master"
]]
;
then
echo
">> This script must be run under
\`
master
\`
branch"
exit
fi
### Releasing
current
=
`
grep
-P
"version
\"
:
\"\d
+.
\d
+.
\d
+(
\w
*)"
package.json |
grep
-oP
"
\d
+.
\d
+.
\d
+(
\w
*)"
`
echo
"Current version:
$current
"
case
"
$1
"
in
del
)
if
[[
$2
=
~ ^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+
$
]]
;
then
result
=
`
curl
-i
'https://api.github.com/repos/duniter/cesium/releases/tags/v'
"
$current
"
''
`
release_url
=
`
echo
"
$result
"
|
grep
-P
"
\"
url
\"
:
\"
[^
\"
]+"
|
grep
-oP
"https://api.github.com/repos/duniter/cesium/releases/
\d
+"
`
if
[[
$release_url
!=
""
]]
;
then
echo
"Deleting existing release..."
curl
-XDELETE
$release_url
-u
$2
fi
else
echo
"Wrong argument"
echo
"Usage:"
echo
" > ./github.sh del user:password"
exit
fi
;;
pre|rel
)
if
[[
$2
=
~ ^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+
$
&&
$3
!=
""
]]
;
then
if
[[
$1
=
"pre"
]]
;
then
prerelease
=
"true"
else
prerelease
=
"false"
fi
result
=
`
curl
-i
'https://api.github.com/repos/duniter/cesium/releases/tags/v'
"
$current
"
''
`
release_url
=
`
echo
"
$result
"
|
grep
-P
"
\"
url
\"
:
\"
[^
\"
]+"
|
grep
-oP
"https://api.github.com/repos/duniter/cesium/releases/
\d
+"
`
if
[[
$release_url
!=
""
]]
;
then
echo
"Deleting existing release..."
curl
-XDELETE
$release_url
-u
$2
fi
echo
"Creating new release..."
result
=
`
curl
-i
https://api.github.com/repos/duniter/cesium/releases
-u
$2
-d
'{"tag_name": "v'
"
$current
"
'","target_commitish": "master","name": "'
"
$current
"
'","body": "'
"
$3
"
'","draft": false,"prerelease": '
"
$prerelease
"
'}'
`
upload_url
=
`
echo
"
$result
"
|
grep
-P
"upload_url
\"
:
\"
[^
\"
]+"
|
grep
-oP
"https://[a-z0-9/.]+"
`
echo
$upload_url
### Sending files
echo
"Sending binaries..."
curl
-i
''
"
$upload_url
"
'?name=cesium-v'
"
$current
"
'-web.zip'
-u
$2
-H
'Content-Type: application/zip'
--data
'@platforms/web/build/cesium-web-'
"
$current
"
'.zip'
curl
-i
''
"
$upload_url
"
'?name=cesium-v'
"
$current
"
'-firefoxos.zip'
-u
$2
-H
'Content-Type: application/zip'
--data
'@platforms/firefoxos/build/package.zip'
curl
-i
''
"
$upload_url
"
'?name=cesium-v'
"
$current
"
'-android.apk'
-u
$2
-H
'Content-Type: application/vnd.android.package-archive'
--data
'@platforms/android/build/outputs/apk/android-release.apk'
else
echo
"Wrong arguments"
echo
"Usage:"
echo
" > ./github.sh pre|rel user:password <release_description>"
echo
"With:"
echo
" - pre: use for pre-release"
echo
" - rel: for full release"
exit
fi
;;
*
)
echo
"No task given"
;;
esac
This diff is collapsed.
Click to expand it.
release.sh
+
5
−
2
View file @
5aa9cbb2
...
...
@@ -16,7 +16,8 @@ currentAndroid=`grep -P "android-versionCode=\"\d+\"" config.xml | grep -oP "\d+
echo
"Current Android version:
$currentAndroid
"
if
[[
$2
=
~ ^[0-9]+.[0-9]+.[0-9]+
((
a|b
)[
0-9]+
)
?
$
&&
$3
=
~ ^[0-9]+
$
]]
;
then
echo
"build
$2
"
echo
"new build version:
$2
"
echo
"new build android version:
$3
"
case
"
$1
"
in
rel|pre
)
# Change the version in package.json and test file
...
...
@@ -41,10 +42,11 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
esac
git commit
-m
"v
$2
"
git tag
"v
$2
"
git push
else
echo
"Wrong version format"
echo
"Usage:"
echo
" > release.sh [pre|rel] <version> <android-version>"
echo
" >
./
release.sh [pre|rel] <version> <android-version>"
echo
"with:"
echo
" - version: x.y.z"
echo
" - android-version: nnn"
...
...
@@ -62,3 +64,4 @@ gulp build:web --release
This diff is collapsed.
Click to expand it.
www/js/config.js
+
2
−
2
View file @
5aa9cbb2
...
...
@@ -28,8 +28,8 @@ angular.module("cesium.config", [])
"
port
"
:
"
9203
"
}
},
"
version
"
:
"
0.2.
3
"
,
"
build
"
:
"
2016-08-23T09:
25
:41.
250
Z
"
,
"
version
"
:
"
0.2.
4
"
,
"
build
"
:
"
2016-08-23T09:
43
:41.
411
Z
"
,
"
newIssueUrl
"
:
"
https://github.com/duniter/cesium/issues/new?labels=bug
"
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment