Merge pull request #75 from justdan96/enhancement-nightly-build

Enhancement nightly build
This commit is contained in:
Dan 2019-12-14 13:31:01 +00:00 committed by GitHub
commit f7c8988b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 104 additions and 4 deletions

41
.github/workflows/nightly.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Nightly Releases
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
container:
image: docker://justdan96/tsmuxer_build:latest
volumes:
- /workspace:/github/workspace
steps:
- uses: actions/checkout@master
name: checkout
- run: rm -f bin/.gitkeep
name: clean-bin-folder
- run: ./rebuild_linux_with_gui_docker.sh
name: build-for-linux
- run: ./rebuild_mxe_with_gui_docker.sh
name: build-for-win64
- run: ./rebuild_mxe32_with_gui_docker.sh
name: build-for-win32
- run: ./rebuild_osxcross_with_gui_docker.sh
name: build-for-mac
- run: ./bintray_nightly_upload.sh
name: upload-to-bintray-nightly
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}

42
bintray_nightly_upload.sh Executable file
View File

@ -0,0 +1,42 @@
# BINTRAY_USER
# BINTRAY_API_KEY
BINTRAY_REPO=tsMuxer
PCK_NAME=tsMuxerGUI-Nightly
repo_commit=$(curl -s https://dl.bintray.com/$BINTRAY_USER/$BINTRAY_REPO/:commit.txt)
local_commit=$(git rev-parse HEAD)
version_date=$(date +%Y-%m-%d--%H-%M-%S)
if [ "$repo_commit" = "$local_commit" ] ; then
echo "latest nightly build already in bintray!"
exit 1
else
# create a new version with the timestamp
version_data='{ "name": "'
version_data+=$version_date
version_data+='", "desc": "tsMuxer CLI and GUI binaries built on '
version_data+=$version_date
version_data+='"}'
echo $version_data
version_created=$(curl -u$BINTRAY_USER:$BINTRAY_API_KEY -H "Content-Type: application/json" --write-out %{http_code} --silent --output /dev/null --request POST --data "$version_data" https://api.bintray.com/packages/$BINTRAY_USER/$BINTRAY_REPO/$PCK_NAME/versions)
if [ $version_created -eq 201 ] ; then
echo "version $version_date has been created!"
# upload the ZIP files to the version we just created on bintray
echo "uploading files..."
curl -T ./bin/mac.zip -u$BINTRAY_USER:$BINTRAY_API_KEY -H "X-Bintray-Package:$PCK_NAME" -H "X-Bintray-Version:$version_date" -H "X-Bintray-Publish:1" -H "X-Bintray-Override:1" https://api.bintray.com/content/$BINTRAY_USER/$BINTRAY_REPO/mac-nightly-$version_date.zip
curl -T ./bin/w32.zip -u$BINTRAY_USER:$BINTRAY_API_KEY -H "X-Bintray-Package:$PCK_NAME" -H "X-Bintray-Version:$version_date" -H "X-Bintray-Publish:1" -H "X-Bintray-Override:1" https://api.bintray.com/content/$BINTRAY_USER/$BINTRAY_REPO/w32-nightly-$version_date.zip
curl -T ./bin/w64.zip -u$BINTRAY_USER:$BINTRAY_API_KEY -H "X-Bintray-Package:$PCK_NAME" -H "X-Bintray-Version:$version_date" -H "X-Bintray-Publish:1" -H "X-Bintray-Override:1" https://api.bintray.com/content/$BINTRAY_USER/$BINTRAY_REPO/w64-nightly-$version_date.zip
curl -T ./bin/lnx.zip -u$BINTRAY_USER:$BINTRAY_API_KEY -H "X-Bintray-Package:$PCK_NAME" -H "X-Bintray-Version:$version_date" -H "X-Bintray-Publish:1" -H "X-Bintray-Override:1" https://api.bintray.com/content/$BINTRAY_USER/$BINTRAY_REPO/lnx-nightly-$version_date.zip
echo "files uploaded!"
# update the latest commit on bintray
echo "updating commit record on bintray..."
echo $local_commit > commit.txt
curl -T commit.txt -u$BINTRAY_USER:$BINTRAY_API_KEY -H "X-Bintray-Package:commit" -H "X-Bintray-Version:latest" -H "X-Bintray-Publish:1" -H "X-Bintray-Override:1" https://api.bintray.com/content/$BINTRAY_USER/$BINTRAY_REPO/commit.txt
rm -f commit.txt
echo "commit record updated!"
else
echo "error creating version $version_date !"
exit 2
fi
fi

View File

@ -7,4 +7,8 @@ cp tsMuxer/tsmuxer ../bin/tsMuxeR
cp tsMuxerGUI/tsMuxerGUI ../bin/tsMuxerGUI
cd ..
rm -rf build
ls ./bin/tsMuxeR && ls ./bin/tsMuxerGUI
mkdir ./bin/lnx
mv ./bin/tsMuxeR ./bin/lnx/tsMuxeR
mv ./bin/tsMuxerGUI ./bin/lnx/tsMuxerGUI
zip -jr ./bin/lnx.zip ./bin/lnx
ls ./bin/lnx/tsMuxeR && ls ./bin/lnx/tsMuxerGUI && ls ./bin/lnx.zip

View File

@ -31,4 +31,8 @@ cd ..
rm -rf build
rm -f ./tsMuxerGUI/tsMuxerGUI.pro
ls ./bin/tsMuxeR.exe && ls ./bin/tsMuxerGUI.exe
mkdir ./bin/w32
mv ./bin/tsMuxeR.exe ./bin/w32/tsMuxeR.exe
mv ./bin/tsMuxerGUI.exe ./bin/w32/tsMuxerGUI.exe
zip -jr ./bin/w32.zip ./bin/w32
ls ./bin/w32/tsMuxeR.exe && ls ./bin/w32/tsMuxerGUI.exe && ls ./bin/w32.zip

View File

@ -31,4 +31,8 @@ cd ..
rm -rf build
rm -f ./tsMuxerGUI/tsMuxerGUI.pro
ls ./bin/tsMuxeR.exe && ls ./bin/tsMuxerGUI.exe
mkdir ./bin/w64
mv ./bin/tsMuxeR.exe ./bin/w64/tsMuxeR.exe
mv ./bin/tsMuxerGUI.exe ./bin/w64/tsMuxerGUI.exe
zip -jr ./bin/w64.zip ./bin/w64
ls ./bin/w64/tsMuxeR.exe && ls ./bin/w64/tsMuxerGUI.exe && ls ./bin/w64.zip

View File

@ -44,4 +44,9 @@ EOF
fi
rm -rf build
ls ./bin/tsMuxeR && ls ./bin/tsMuxerGUI.app/Contents/MacOS/tsMuxerGUI
mkdir ./bin/mac
mv ./bin/tsMuxeR ./bin/mac/tsMuxeR
mv ./bin/tsMuxerGUI.app ./bin/mac/tsMuxerGUI.app
zip -jr ./bin/mac.zip ./bin/mac
ls ./bin/mac/tsMuxeR && ls ./bin/mac/tsMuxerGUI.app/Contents/MacOS/tsMuxerGUI && ls ./bin/mac.zip