-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate creating and uploading release
- Loading branch information
Showing
4 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ cfg/ | |
*.sym | ||
config.inc | ||
*.bin | ||
!a2vmemnoram.bin | ||
!a2vmemnoram.bin | ||
*.zip | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
FILES="apple2.bin LICENSE.html README.html" | ||
DELETE="README.html LICENSE.html" | ||
|
||
abort() { | ||
echo "Aborting: $*" | ||
rm -f $DELETE | ||
exit -1 | ||
} | ||
|
||
checktool() { | ||
if ! $* > /dev/null 2>&1 ; then | ||
abort "\"$1\" is required but was not found." | ||
fi | ||
} | ||
|
||
md2html() { | ||
B=`basename $1 .md` | ||
H=$B.html | ||
if ! pandoc $1 -f markdown -t html -s -o $H -V mainfont=sans-serif -V maxwidth=50em --metadata title="$B" | ||
then | ||
abort "Couldn't create README.html" | ||
fi | ||
} | ||
|
||
checktool git --version | ||
checktool gh --version | ||
checktool zip --version | ||
checktool pandoc --version | ||
|
||
if [ "x$1" == "x" ]; then | ||
echo "Usage: $0 <version>" | ||
exit -1 | ||
fi | ||
|
||
TAG=$1 | ||
|
||
STATUS=`git status --porcelain` | ||
if [ "x$STATUS" != "x" ]; then | ||
git status --short | ||
abort "Working directory contains modified files." | ||
fi | ||
|
||
if ! git tag -a $1 -m $1 ; then | ||
abort "Failed to create git tag \"$1\"" | ||
fi | ||
if ! git push origin $1 ; then | ||
abort "Failed to push \"$1\" to the origin" | ||
fi | ||
|
||
ZIPFILE=appleII_deadtest-BIN-$TAG.zip | ||
|
||
if ! make cleanall all ; then | ||
abort "Couldn't create \"$ZIPFILE\"" | ||
fi | ||
|
||
md2html README.md | ||
md2html LICENSE.md | ||
|
||
if ! zip $ZIPFILE $FILES ; then | ||
abort "Couldn't create \"$ZIPFILE\"" | ||
fi | ||
|
||
if ! gh release create $TAG --draft --generate-notes ; then | ||
abort "Couldn't create the release" | ||
fi | ||
|
||
if ! gh release upload $TAG $FILES $ZIPFILE ; then | ||
abort "Couldn't upload the release files" | ||
fi |