view build_upload_win_nightly @ 1863:d60f2d7c02a5

Differentiate between the full Sega mapper and the SRAM only one. Fixes crash on save state load for Phantasy Star IV and other games that use the same mapper
author Michael Pavone <pavone@retrodev.com>
date Tue, 14 May 2019 23:20:35 -0700
parents 601ef72cc16f
children
line wrap: on
line source

#!/bin/sh
name=$1
. "$HOME/$name.params"
cd $HOME/$DIR
hg revert -a
hg pull
hg up
rev=`hg summary |  sed -E -n 's/^parent: [^:]+:([^ ]+) .*$/\1/p'`
sed -i -E "s/(define BLASTEM_VERSION \"[^-]+)-pre\"/\1-pre-$rev\"/" blastem.c
export OS
./build_release > /tmp/build_${name}_out.log
result=$?
if [ $result -ne 0 ]; then
	echo Build falied with return code $result
	curdate=`date -Iseconds`
	curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
{
	"embeds": [
		{
			"title": "Build $name failed!",
			"type": "rich",
			"description": "Build falied with return code $result",
			"timestamp": "$curdate",
			"color": 16711680
		}
	]
}
WEBHOOKEOF
	exit $result
fi
. $HOME/remote.params
artifact=$(tail -n 1 /tmp/build_${name}_out.log)
echo "Uploaing $artifact to $REMOTE_HOST"
scp -i "$REMOTE_IDENT" "$HOME/$DIR/$artifact" $REMOTE_USER@$REMOTE_HOST:/home/$REMOTE_USER/nightlies
curdate=`date -Iseconds`
version=`echo "$artifact" | sed -E 's/[^-]+-([0-9]+\.[0-9]+\.[0-9]+[^.]*)\..*$/\1/'`
curl -d'@-' -H 'Content-Type: application/json' "$WEBHOOKURL" <<WEBHOOKEOF
{
	"embeds": [
		{
			"title": "$artifact",
			"type": "rich",
			"url": "https://www.retrodev.com/blastem/nightlies/$artifact",
			"description": "New build of $name succeeded!",
			"timestamp": "$curdate",
			"color": 65280,
			"fields": [
				{
					"name": "Version",
					"value": "$version"
				}
			]
		}
	]
}
WEBHOOKEOF