]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/infrastructure/xonotic-release-build.cron
Fix macOS SDL2 framework permissions
[xonotic/xonotic.git] / misc / infrastructure / xonotic-release-build.cron
1 #!/bin/sh
2
3 if [ -z "$RELEASETYPE" ]; then
4         export RELEASETYPE=autobuild
5         #export RELEASETYPE=release
6 fi
7
8 case "$RELEASETYPE" in
9         autobuild)
10                 RELEASETYPEDIR=
11                 RELEASETYPENAME="$RELEASETYPE"
12                 ;;
13         RC*)
14                 RELEASETYPEDIR="$RELEASETYPE/"
15                 RELEASETYPENAME="Release Candidate"
16                 ;;
17         *)
18                 RELEASETYPEDIR="$RELEASETYPE/"
19                 RELEASETYPENAME="$RELEASETYPE-like build"
20                 ;;
21 esac
22
23 # is being run as cronjob, better set PATH
24 export PATH=/home/xonotic-build/ccache:/home/xonotic-build/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
25
26 # TEST: use s2tc, high quality
27 #export dds_tool=s2tc
28
29 # Try crunch.
30 export CACHEDIR=$HOME/.xonotic-cached-converter-crunch
31 export dds_tool=crunch
32
33 # Build locally.
34 export HOSTS_THAT_ARE_MYSELF='xonotic-build-win32 xonotic-build-win64 xonotic-build-osx'
35 export HOSTS_THAT_ARE_SCHROOT='xonotic-build-linux64'
36
37 mepwd=$PWD
38 me=$0
39
40 if rm "$me.not-today" 2>/dev/null; then
41         echo "No build today (not-today marker removed)!"
42         exit 0
43 fi
44
45 set -ex
46
47 test -z "$RELEASETYPEDIR" && ssh autobuild-release-uploader@beta.xonotic.org '
48         set -e;
49         s0=`date -d "now - 30 days - 12 hours" +%s`;
50         s00=`date -d "now - 60 days - 12 hours" +%s`;
51         for X in * */*; do
52                 [ -f "$X" ] || continue;
53                 d=${X##*/};
54                 d=${d#Xonotic-};
55                 d=${d#gmqcc-};
56                 d=${d%%[-_.]*};
57                 [ x"$d" != x"latest" ] || continue;
58                 w=`date -d $d +%w`;
59                 s=`date -d $d +%s`;
60                 w=$(($w % 2));
61                 if [ "$w" -ne 0 -a "$s" -lt "$s0" -o "$s" -lt "$s00" ]; then
62                         rm -f "$X";
63                 fi;
64         done
65 '
66
67 cd ~/xonotic-release-build
68 ./all clean --reclone
69 # ./all checkout maint
70 ./all checkout
71 ./all each git checkout HEAD^0
72 # add all feature branches we want
73
74 # map branches that we include:
75 #   winners in the poll for upcoming CTF maps
76 #   maps near completion
77
78 #for b in \
79 #       origin/divVerent/selfbuildagain \
80 #; do
81 #       b=$b ./all each sh -c 'if git rev-parse $b >/dev/null 2>&1; then git merge $b; fi'
82 #done
83 ./all update -N
84 ./all each git restore-mtime --commit-time # adding --merge would be more correct but is slow and hits git limits
85 d0=`date +%Y%m%d`
86 d=$d0
87 i=1
88 while HEAD -C xonotic:g-23 http://beta.xonotic.org/autobuild/"$RELEASETYPEDIR""Xonotic-$d.zip"; do
89         i=$(($i+1))
90         d="$d0"_"$i"
91 done
92 RELEASEDATE=$d ./all release
93 sha512sum Xonotic-$d*.zip > Xonotic-$d.sha512
94 if [ -z "$RELEASETYPEDIR" ]; then
95         sleep 1 # newer timestamps for correct file sort order in web gui
96         for X in Xonotic-$d*.zip; do
97                 ln -snf "$X" "Xonotic-latest${X#Xonotic-$d}"
98         done
99         sha512sum Xonotic-latest*.zip > Xonotic-latest.sha512
100 fi
101 rsync -vaSHP Xonotic*.zip Xonotic*.sha512 autobuild-release-uploader@beta.xonotic.org:"$RELEASETYPEDIR"
102 if [ -z "$RELEASETYPEDIR" ]; then
103         ssh autobuild-release-uploader@beta.xonotic.org sh ../../update-rsync.sh "$d"
104
105         # pipeline files, see: .gitlab-ci.yml in xonotic-data.pk3dir
106         cp data/stormkeep-????????????????????????????????????????-????????????????????????????????????????.pk3 stormkeep.pk3
107         PIPELINE_FILES="gmqcc/gmqcc Xonotic/xonotic-linux64-dedicated stormkeep.pk3"
108         rsync -vSP $PIPELINE_FILES autobuild-release-uploader@beta.xonotic.org:../pipeline-bin/
109         rm -f stormkeep.pk3
110 fi
111 echo "Finished a new $RELEASETYPENAME at http://beta.xonotic.org/autobuild/$RELEASETYPEDIR" | $IRCSPAM
112 cd