File tree Expand file tree Collapse file tree 5 files changed +106
-6
lines changed Expand file tree Collapse file tree 5 files changed +106
-6
lines changed Original file line number Diff line number Diff line change 1
1
version : 2
2
2
3
3
jobs :
4
- test :
5
- working_directory : ~/tgst
4
+ build :
6
5
docker :
7
6
- image : tomaka/cargo-apk
8
7
steps :
9
8
- checkout
10
9
- run : cargo apk build
11
10
11
+ deploy :
12
+ docker :
13
+ - image : tomaka/cargo-apk
14
+ steps :
15
+ - checkout
16
+ - run : git clone --depth=1 https://github.com/ozkriff/zemeroth_assets assets
17
+ - run : cargo apk build
18
+ - run : ./.circleci/upload_apk_to_github_releases.sh
19
+
12
20
workflows :
13
21
version : 2
14
- build-test- and-deploy :
22
+ build-and-deploy :
15
23
jobs :
16
- - test
24
+ - build :
25
+ filters :
26
+ tags :
27
+ ignore : /.*/
28
+ - deploy :
29
+ filters :
30
+ tags :
31
+ only : /.*/
32
+ branches :
33
+ ignore : /.*/
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # Based on https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
4
+
5
+ # https://github.com/settings/tokens -> circleci's env GITHUB_API_TOKEN
6
+
7
+ set -e
8
+
9
+ tag=$CIRCLE_TAG
10
+ owner=$CIRCLE_PROJECT_USERNAME
11
+ repo=$CIRCLE_PROJECT_REPONAME
12
+ filename=./zemeroth-debug.apk
13
+ GH_REPO=" https://api.github.com/repos/$owner /$repo "
14
+ GH_TAGS=" $GH_REPO /releases/tags/$tag "
15
+ AUTH=" Authorization: token $GITHUB_API_TOKEN "
16
+
17
+ cp ./target/android-artifacts/app/build/outputs/apk/app-debug.apk $filename
18
+
19
+ # Validate token.
20
+ curl -o /dev/null -sH " $AUTH " $GH_REPO || { echo " Error: Invalid repo, token or network issue!" ; exit 1; }
21
+
22
+ # Create a release
23
+ RELEASE_URL=" https://api.github.com/repos/$owner /$repo /releases?access_token=$GITHUB_API_TOKEN "
24
+ curl --data " {\" tag_name\" : \" $tag \" }" $RELEASE_URL
25
+
26
+ # Read asset tags
27
+ response=$( curl -sH " $AUTH " $GH_TAGS )
28
+
29
+ # Get ID of the asset based on given filename
30
+ eval $( echo " $response " | grep -m 1 " id.:" | grep -w id | tr : = | tr -cd ' [[:alnum:]]=' )
31
+ [ " $id " ] || { echo " Error: Failed to get release id for tag: $tag " ; echo " $response \n" >&2 ; exit 1; }
32
+
33
+ # Upload the asset
34
+ GH_ASSET=" https://uploads.github.com/repos/$owner /$repo /releases/$id /assets?name=$( basename $filename ) "
35
+ curl --data-binary @" $filename " -H " $AUTH " -H " Content-Type: application/octet-stream" $GH_ASSET
Original file line number Diff line number Diff line change 1
1
language : rust
2
2
3
+ env :
4
+ - zipname="zemeroth-$TRAVIS_OS_NAME.tar.gz"
5
+
3
6
cache : cargo
4
7
5
8
rust :
18
21
sudo : false
19
22
20
23
script :
21
- - cargo build && cargo test
24
+ - cargo build
25
+ - cargo test
26
+ - cargo build --release
27
+
28
+ before_deploy :
29
+ - git clone --depth=1 https://github.com/ozkriff/zemeroth_assets assets
30
+ - mv target/release/zemeroth .
31
+ - tar -zcvf $zipname assets zemeroth
32
+
33
+ deploy :
34
+ provider : releases
35
+ skip_cleanup : true
36
+ overwrite : true
37
+ file : $zipname
38
+ api_key :
39
+ secure : sn8NPGcybxiRAIDp5Tk5nhvg89PTgm75VjkyjYfufKmuk3KDOhW2b2CYC6VvlM88a4FAMSWDaYXKi0N3yEYFC2RmqrvtpocBGKsom2fSmvRv/4YWIWCOK7Zpw7IBhRfTn/2dHkLa3Uy+7dyO96LW8qtiuEsotyJCrWaXuLr1+wYdWXWL6oeGsw41sB22Umc4WZJP/SryjGb+5b349WNCipf0rMLdU0sqW7fOJfIg0cv9W1k9FiuHLfw3Li1JzU2qo5TWX3oxv8MPFQ9/lVEHAYkI8tvxaSheN/L3xlpWV1Qjrk9vxN1bIVygyCaARJhzTgTAZ+OH4B1h1Mkwc0emY6ITRbcN4khko599E17AvmhVrB7xE0wNtJtVS9z2coWqcC4MO1yLIFGyC8hxH6BubmGTQln1q7KRy48l8uNJczfW+vi6lwj8Sni0HungZZBzyfv6eNPzU0IZE6rh+FN2pmdfaqAxjo8BPfyZvJFuJqJcTNvUkdT9fXyILgHuzdEmQBOVZhzqn3jOJfv3kHpaEF7prywEEzRr0A4S1RvMCyYN9PH7XvcGKGq1dJNEwCHmgnUfuCkROBKBnsa9PvJTPy3tHY7Z0EhveoQYXMnfhlqN3LTBb3l6Gwg2GK1lajLuLB/Q6tGKuGgRI1r5sLwqPFioIjuL71LecnAgyMilm5c=
40
+ on :
41
+ tags : true
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ News: https://twitter.com/ozkriff
14
14
Devlog album: http://imgur.com/a/SMVqO
15
15
16
16
17
+ Downloads
18
+ ---------
19
+
20
+ Precompiled binaries for linux, win, osx and android: https://github.com/ozkriff/zemeroth/releases
21
+
22
+
17
23
Overview
18
24
--------
19
25
Original file line number Diff line number Diff line change 1
1
environment :
2
+ global :
3
+ PROJECT_NAME : zemeroth
2
4
matrix :
3
5
- TARGET : i686-pc-windows-gnu
4
6
CHANNEL : stable
@@ -28,8 +30,28 @@ install:
28
30
build : false
29
31
30
32
test_script :
31
- - cmd : ' cargo build && cargo test'
33
+ - cmd : ' cargo build && cargo test && cargo build --release '
32
34
33
35
cache :
34
36
- target
35
37
- C:\Users\appveyor\.cargo\registry
38
+
39
+ before_deploy :
40
+ - mkdir staging
41
+ - mkdir staging\assets
42
+ - copy target\release\zemeroth.exe staging
43
+ - cd staging
44
+ - git clone --depth=1 https://github.com/ozkriff/zemeroth_assets assets
45
+ - 7z a ../%PROJECT_NAME%-%TARGET%.zip *
46
+ - appveyor PushArtifact ../%PROJECT_NAME%-%TARGET%.zip
47
+
48
+ deploy :
49
+ provider : GitHub
50
+ artifact : /.*\.zip/
51
+ auth_token :
52
+ secure : ENk8Tp+3wU90QF5utTGj5QM3bYyXHRtWm+mMgH+SotiCbIRc6mf0DsoKQgA1F/64
53
+ on :
54
+ CHANNEL : stable
55
+ appveyor_repo_tag : true
56
+ branch :
57
+ - master
You can’t perform that action at this time.
0 commit comments