mirror of
https://github.com/digarok/gsplus.git
synced 2024-06-08 10:45:07 +00:00
New CI pushes builds to S3 and creates an updated webpage in final stage
- also turned off some builds for experimental branch (now set to build on master only) - S3 push uses/requires new env vars from gitlabci project settings - also the builds all have some kind of packaging now (zip/dmg)
This commit is contained in:
parent
7d82873478
commit
c8c0f04173
184
.gitlab-ci.yml
184
.gitlab-ci.yml
|
@ -1,9 +1,12 @@
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- package
|
- package
|
||||||
|
- deploy
|
||||||
|
- updatewebsite
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: UBUNTU X
|
||||||
build-ubuntu-x:
|
build-ubuntu-x:
|
||||||
tags:
|
tags:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
|
@ -16,7 +19,9 @@ build-ubuntu-x:
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplusx
|
- gsplusx
|
||||||
expire_in: 5 minutes
|
expire_in: 10 minutes
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
package-ubuntu-x:
|
package-ubuntu-x:
|
||||||
tags:
|
tags:
|
||||||
|
@ -32,10 +37,12 @@ package-ubuntu-x:
|
||||||
- config.txt
|
- config.txt
|
||||||
- doc/gsplusmanual.pdf
|
- doc/gsplusmanual.pdf
|
||||||
- doc/LICENSE.txt
|
- doc/LICENSE.txt
|
||||||
|
expire_in: 10 minutes
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: DEPRECATED, UBUNTU SDL
|
||||||
|
|
||||||
build-ubuntu-sdl:
|
build-ubuntu-sdl:
|
||||||
tags:
|
tags:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
|
@ -45,11 +52,11 @@ build-ubuntu-sdl:
|
||||||
- cd src
|
- cd src
|
||||||
- ln -s vars_x86linux_sdl vars
|
- ln -s vars_x86linux_sdl vars
|
||||||
- make clean ; make
|
- make clean ; make
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: REALLY ANY LINUX, BUT UBUNTU W SDL2
|
||||||
|
|
||||||
|
|
||||||
build-ubuntu-sdl2:
|
build-ubuntu-sdl2:
|
||||||
tags:
|
tags:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
|
@ -59,32 +66,48 @@ build-ubuntu-sdl2:
|
||||||
- cd src
|
- cd src
|
||||||
- ln -s vars_x86linux_sdl2 vars
|
- ln -s vars_x86linux_sdl2 vars
|
||||||
- make clean ; make
|
- make clean ; make
|
||||||
- mv ../gsplus ../gsplus-ubuntu-sdl
|
- mv ../gsplus ../gsplus-ubuntu-sdl.bin
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus-ubuntu-sdl
|
- gsplus-ubuntu-sdl.bin
|
||||||
expire_in: 5 minutes
|
expire_in: 10 minutes
|
||||||
|
|
||||||
package-ubuntu-sdl2:
|
package-ubuntu-sdl2:
|
||||||
tags:
|
tags:
|
||||||
- ubuntu
|
- ubuntu
|
||||||
stage: package
|
stage: package
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: fetch
|
||||||
|
PACKAGE_DIR: gsplus-ubuntu-sdl
|
||||||
script:
|
script:
|
||||||
- cp src/config.txt .
|
- mkdir $PACKAGE_DIR
|
||||||
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
|
- mkdir $PACKAGE_DIR/doc
|
||||||
- cp LICENSE.txt doc/
|
- mv gsplus-ubuntu-sdl.bin $PACKAGE_DIR/gsplus
|
||||||
- mv gsplus-ubuntu-sdl gsplus
|
- cp src/config.txt $PACKAGE_DIR
|
||||||
|
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> $PACKAGE_DIR/config.txt'
|
||||||
|
- cp src/parallel.rom %PACKAGE_DIR%
|
||||||
|
- cp LICENSE.txt $PACKAGE_DIR/doc/
|
||||||
|
- cp doc/gsplusmanual.pdf %PACKAGE_DIR%
|
||||||
|
- cp doc/README.txt %PACKAGE_DIR%
|
||||||
|
- tar -cvjf gsplus-ubuntu-sdl.tar.bz2 $PACKAGE_DIR
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus
|
- gsplus-ubuntu-sdl.tar.bz2
|
||||||
- config.txt
|
expire_in: 10 minutes
|
||||||
- doc/README.txt
|
deploy-ubuntu:
|
||||||
- doc/gsplusmanual.pdf
|
tags:
|
||||||
- doc/LICENSE.txt
|
- ubuntu
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- aws s3 cp gsplus-ubuntu-sdl.tar.bz2 s3://$AWS_BUCKET/$CI_TAG/$CI_VERSION/$CI_PIPELINE_ID/ubuntu-sdl/$CI_BUILD_ID/ --acl public-read
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: OSX 10.SOMETHING
|
||||||
build-osx:
|
build-osx:
|
||||||
tags:
|
tags:
|
||||||
- osx
|
- osx
|
||||||
|
@ -97,7 +120,7 @@ build-osx:
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus-osx
|
- gsplus-osx
|
||||||
expire_in: 5 minutes
|
expire_in: 10 minutes
|
||||||
|
|
||||||
package-osx:
|
package-osx:
|
||||||
tags:
|
tags:
|
||||||
|
@ -114,10 +137,19 @@ package-osx:
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- GSplus-Install.dmg
|
- GSplus-Install.dmg
|
||||||
|
expire_in: 10 minutes
|
||||||
|
|
||||||
|
deploy-osx:
|
||||||
|
tags:
|
||||||
|
- osx
|
||||||
|
stage: deploy
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- aws s3 cp GSplus-Install.dmg s3://$AWS_BUCKET/$CI_TAG/$CI_VERSION/$CI_PIPELINE_ID/osx/$CI_BUILD_ID/ --acl public-read
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: WIN32 WIN API UNDER CYGWIN
|
||||||
|
|
||||||
build-win32:
|
build-win32:
|
||||||
tags:
|
tags:
|
||||||
- windows
|
- windows
|
||||||
|
@ -127,7 +159,9 @@ build-win32:
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus32.exe
|
- gsplus32.exe
|
||||||
expire_in: 5 minutes
|
expire_in: 10 minutes
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
package-win32:
|
package-win32:
|
||||||
tags:
|
tags:
|
||||||
|
@ -153,11 +187,12 @@ package-win32:
|
||||||
- cygstdc++-6.dll
|
- cygstdc++-6.dll
|
||||||
- cygwin1.dll
|
- cygwin1.dll
|
||||||
- cygfreetype-6.dll
|
- cygfreetype-6.dll
|
||||||
|
expire_in: 10 minutes
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
# TARGET SYSTEM: WIN32 SDL2 UNDER CYGWIN W MINGW64 SDL2 LIBS
|
||||||
|
|
||||||
|
|
||||||
build-win-sdl2:
|
build-win-sdl2:
|
||||||
tags:
|
tags:
|
||||||
- windows
|
- windows
|
||||||
|
@ -167,66 +202,61 @@ build-win-sdl2:
|
||||||
- ln -s vars_win32_sdl2 vars
|
- ln -s vars_win32_sdl2 vars
|
||||||
- make clean
|
- make clean
|
||||||
- make
|
- make
|
||||||
- cp parallel.rom ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygbz2-1.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygfreetype-6.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cyggcc_s-1.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygpng16-16.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygstdc++-6.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygwin1.dll ..
|
|
||||||
- cp /cygdrive/c/cygwin/bin/cygz.dll ..
|
|
||||||
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2.dll ..
|
|
||||||
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2_image.dll ..
|
|
||||||
|
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus.exe
|
- gsplus.exe
|
||||||
- parallel.rom
|
expire_in: 10 minutes
|
||||||
- cygbz2-1.dll
|
|
||||||
- cygfreetype-6.dll
|
|
||||||
- cyggcc_s-1.dll
|
|
||||||
- cygjpeg-8.dll
|
|
||||||
- cygpng16-16.dll
|
|
||||||
- cygjpeg-8.dll
|
|
||||||
- cygstdc++-6.dll
|
|
||||||
- cygwin1.dll
|
|
||||||
- cygz.dll
|
|
||||||
- SDL2.dll
|
|
||||||
- SDL2_image.dll
|
|
||||||
|
|
||||||
expire_in: 5 minutes
|
|
||||||
|
|
||||||
|
|
||||||
package-win-sdl2:
|
package-win-sdl2:
|
||||||
tags:
|
tags:
|
||||||
- windows
|
- windows
|
||||||
stage: package
|
stage: package
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: fetch
|
||||||
|
PACKAGE_DIR: gsplus-win-sdl
|
||||||
script:
|
script:
|
||||||
- pwd
|
- mkdir %PACKAGE_DIR%
|
||||||
- ls -al
|
- cp gsplus.exe %PACKAGE_DIR%
|
||||||
- cp src/config.txt .
|
- cp LICENSE.txt %PACKAGE_DIR%
|
||||||
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
|
- cp src/config.txt %PACKAGE_DIR%
|
||||||
- cp LICENSE.txt doc/
|
- cp src/parallel.rom %PACKAGE_DIR%
|
||||||
|
- cp doc/gsplusmanual.pdf %PACKAGE_DIR%
|
||||||
|
- cp doc/README.txt %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygbz2-1.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygfreetype-6.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cyggcc_s-1.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygpng16-16.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygstdc++-6.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygwin1.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/cygwin/bin/cygz.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2.dll %PACKAGE_DIR%
|
||||||
|
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2_image.dll %PACKAGE_DIR%
|
||||||
|
- cp gsplus.exe %PACKAGE_DIR%
|
||||||
|
- zip gsplus-win-sdl.zip -r %PACKAGE_DIR%
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- gsplus.exe
|
- gsplus-win-sdl.zip
|
||||||
- config.txt
|
expire_in: 10 minutes
|
||||||
- doc/gsplusmanual.pdf
|
deploy-win-sdl2:
|
||||||
- doc/LICENSE.txt
|
tags:
|
||||||
- doc/README.txt
|
- windows
|
||||||
- parallel.rom
|
stage: deploy
|
||||||
- cygbz2-1.dll
|
variables:
|
||||||
- cygfreetype-6.dll
|
GIT_STRATEGY: none
|
||||||
- cyggcc_s-1.dll
|
script:
|
||||||
- cygjpeg-8.dll
|
- aws s3 cp gsplus-win-sdl.zip s3://%AWS_BUCKET%/%CI_TAG%/%CI_VERSION%/%CI_PIPELINE_ID%/win-sdl/%CI_BUILD_ID%/ --acl public-read
|
||||||
- cygpng16-16.dll
|
|
||||||
- cygjpeg-8.dll
|
update-website-universal:
|
||||||
- cygstdc++-6.dll
|
tags:
|
||||||
- cygwin1.dll
|
- osx
|
||||||
- cygz.dll
|
stage: updatewebsite
|
||||||
- SDL2.dll
|
variables:
|
||||||
- SDL2_image.dll
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- aws s3 ls gsplus-artifacts/ --recursive > s3artifacts.txt
|
||||||
|
- php assets/updatewebsite.php s3artifacts.txt public > index.html
|
||||||
|
- php assets/updatewebsite.php s3artifacts.txt auto > index_auto.html
|
||||||
|
- aws s3 cp index.html s3://$AWS_BUCKET/ --acl public-read
|
||||||
|
- aws s3 cp index_auto.html s3://$AWS_BUCKET/ --acl public-read
|
||||||
|
|
65
assets/updatewebsite.php
Normal file
65
assets/updatewebsite.php
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$d = file_get_contents($argv[1]);
|
||||||
|
$filter = (isset($argv[2])) ? $argv[2] : false;
|
||||||
|
$builds = [];
|
||||||
|
foreach(explode("\n", $d) as $line) {
|
||||||
|
if (!stristr($line, 'gsplus')) { continue; } // only gsplus files
|
||||||
|
$data = explode(" ", $line);
|
||||||
|
$data = preg_split('/\s+/', $line);
|
||||||
|
if (!$data || empty($data) || !isset($data[1])) { continue; } // one more check for validity
|
||||||
|
$b = explode("/", $data[3]);
|
||||||
|
$time = $data[0] . ' ' . $data[1];
|
||||||
|
$date = $data[0];
|
||||||
|
$bytes = $data[2];
|
||||||
|
$k = $b[0].$b[1].$b[2]; // lookup key
|
||||||
|
if (!$k) { continue; } // something isn't right, skip
|
||||||
|
$row = array('k' => $k, 'bytes' => $bytes, 'tag' => $b[0], 'version' => $b[1],
|
||||||
|
'pipeline' => $b[2], 'platform' => $b[3], 'job' => $b[4],
|
||||||
|
'time' => $time, 'date' => $date,
|
||||||
|
'filename' => $b[5], 's3url' => 'https://s3.amazonaws.com/gsplus-artifacts/'.$data[3]
|
||||||
|
);
|
||||||
|
if (!$filter || ($filter && $b[0] == $filter)) {
|
||||||
|
$builds[] = $row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$pipeline = array_column($builds, 'pipeline');
|
||||||
|
$platform = array_column($builds, 'platform');
|
||||||
|
|
||||||
|
array_multisort($pipeline, SORT_DESC, $platform, SORT_ASC, $builds);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$style = <<<EOF
|
||||||
|
.builddiv {
|
||||||
|
width: 80%;
|
||||||
|
-moz-border-radius: 1em 4em 1em 4em;
|
||||||
|
border-radius: 1em 4em 1em 4em;
|
||||||
|
padding: 2em;
|
||||||
|
background-color: #fff;
|
||||||
|
color: #000;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
body { font-family: verdana, sans-serif; font-size: 12px; color: #000; background-color: #18BC9C; font-style: normal; font-weight: normal; font-variant: normal; text-align: left; letter-spacing: 0px; line-height: 20px; }
|
||||||
|
EOF;
|
||||||
|
|
||||||
|
print("<html><head><title>GS+ builds page</title><style>$style</style></head><body>\n");
|
||||||
|
$lastk = null;
|
||||||
|
foreach ($builds as $l) {
|
||||||
|
$k = $l['k'];
|
||||||
|
if ($k != $lastk) {
|
||||||
|
if ($lastk != null) {
|
||||||
|
print("</div><br/><br/>"); // close last build if not first pass
|
||||||
|
}
|
||||||
|
print("<div class='builddiv'>\n");
|
||||||
|
print("<h1>GSPLUS V".$l['version']." - Pipeline #".$l['pipeline']." @ ".$l['date']." <span style='font-size:0.r68em'>(".$l['tag'].")</span></H1><hr/>\n");
|
||||||
|
$lastk = $k;
|
||||||
|
}
|
||||||
|
print("<h2>Platform: ".$l['platform']."</h2>\n");
|
||||||
|
print("<ul><li>Build Job: ".$l['job']." Date: ".$l['time']." Size(Bytes): ".$l['bytes']."</li>\n");
|
||||||
|
print("<li>Download: <a href='".$l['s3url']."'>".$l['filename']."</a></li></ul>\n");
|
||||||
|
}
|
||||||
|
print("</div></body></html>\n");
|
||||||
|
|
||||||
|
#2018-08-07 14:33:11 256833 auto/0.14rc/260/ubuntu-sdl/2481/gsplus-ubuntu-sdl.tar.bz2
|
|
@ -8,6 +8,8 @@
|
||||||
# Prerequisites: You must install Cygwin on your system.
|
# Prerequisites: You must install Cygwin on your system.
|
||||||
# I install Cygwin with all "Devel" and "Perl" packages.
|
# I install Cygwin with all "Devel" and "Perl" packages.
|
||||||
# I also search for and add any FreeType libs.
|
# I also search for and add any FreeType libs.
|
||||||
|
# If you want to deploy to s3 (gitlabci) then also add pip for python.
|
||||||
|
# If you are deploying the packages then you also need zip.
|
||||||
# You will not use the Cygwin SDL2/image libraries as they are deprecated.
|
# You will not use the Cygwin SDL2/image libraries as they are deprecated.
|
||||||
# Instead you must download the mingw64-w64 libraries and link against those.
|
# Instead you must download the mingw64-w64 libraries and link against those.
|
||||||
wget https://www.libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz
|
wget https://www.libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz
|
||||||
|
@ -26,3 +28,13 @@ git clone git@github.com:digarok/gsplus.git
|
||||||
cd gsplus/src
|
cd gsplus/src
|
||||||
ln -s vars_win32_sdl2 vars
|
ln -s vars_win32_sdl2 vars
|
||||||
make clean ; make
|
make clean ; make
|
||||||
|
|
||||||
|
|
||||||
|
# if you want to make a machine that can also deploy to s3 (gitlabci):
|
||||||
|
pip2.7 install awscli
|
||||||
|
|
||||||
|
# aws creds are to be passed via CI environment variables
|
||||||
|
# also, you have to fix the behavior for windows to run this.
|
||||||
|
# open an Administrator CMD prompt and run:
|
||||||
|
assoc .py=pyautofile
|
||||||
|
ftype pyautofile="c:\cygwin\bin\python" "%1" %*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user