comparison build_upload_win_nightly @ 2053:3414a4423de1 segacd

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sat, 15 Jan 2022 13:15:21 -0800
parents 601ef72cc16f
children
comparison
equal deleted inserted replaced
1692:5dacaef602a7 2053:3414a4423de1
1 #!/bin/sh 1 #!/bin/sh
2 name=$1 2 name=$1
3 3 . "$HOME/$name.params"
4 cd $HOME/blastem_win 4 cd $HOME/$DIR
5 hg revert -a 5 hg revert -a
6 hg pull 6 hg pull
7 hg up 7 hg up
8 rev=`hg summary | sed -E -n 's/^parent: [^:]+:([^ ]+) .*$/\1/p'` 8 rev=`hg summary | sed -E -n 's/^parent: [^:]+:([^ ]+) .*$/\1/p'`
9 sed -i -E "s/(define BLASTEM_VERSION \"[^-]+)-pre\"/\1-pre-$rev\"/" blastem.c 9 sed -i -E "s/(define BLASTEM_VERSION \"[^-]+)-pre\"/\1-pre-$rev\"/" blastem.c
10 export OS=Windows 10 export OS
11 ./build_release > /tmp/build_${name}_out.log 11 ./build_release > /tmp/build_${name}_out.log
12 result=$? 12 result=$?
13 if [ $result -ne 0 ]; then 13 if [ $result -ne 0 ]; then
14 echo Build falied with return code $result 14 echo Build falied with return code $result
15 curdate=`date -Iseconds`
16 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
17 {
18 "embeds": [
19 {
20 "title": "Build $name failed!",
21 "type": "rich",
22 "description": "Build falied with return code $result",
23 "timestamp": "$curdate",
24 "color": 16711680
25 }
26 ]
27 }
28 WEBHOOKEOF
15 exit $result 29 exit $result
16 fi 30 fi
17 . $HOME/remote.params 31 . $HOME/remote.params
18 artifact=$(tail -n 1 /tmp/build_${name}_out.log) 32 artifact=$(tail -n 1 /tmp/build_${name}_out.log)
19 echo "Uploaing $artifact to $REMOTE_HOST" 33 echo "Uploaing $artifact to $REMOTE_HOST"
20 scp -i "$REMOTE_IDENT" "$HOME/blastem_win/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies 34 scp -i "$REMOTE_IDENT" "$HOME/$DIR/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies
35 curdate=`date -Iseconds`
36 version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'`
37 curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
38 {
39 "embeds": [
40 {
41 "title": "$artifact",
42 "type": "rich",
43 "url": "https://www.retrodev.com/blastem/nightlies/$artifact",
44 "description": "New build of $name succeeded!",
45 "timestamp": "$curdate",
46 "color": 65280,
47 "fields": [
48 {
49 "name": "Version",
50 "value": "$version"
51 }
52 ]
53 }
54 ]
55 }
56 WEBHOOKEOF