MOBILE-2846 desktop: Build desktop linux build from Travis
parent
f94719dac9
commit
238487f509
15
.travis.yml
15
.travis.yml
|
@ -1,16 +1,23 @@
|
|||
sudo: required
|
||||
dist: trusty
|
||||
dist: xenial
|
||||
group: edge
|
||||
|
||||
language: node_js
|
||||
node_js:
|
||||
- '8.10'
|
||||
node_js: stable
|
||||
|
||||
before_cache:
|
||||
- rm -rf $HOME/.cache/electron-builder/wine
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- $HOME/.cache/electron
|
||||
- $HOME/.cache/electron-builder
|
||||
|
||||
before_script:
|
||||
- npm install -g @angular/cli
|
||||
- npm i npm@latest -g
|
||||
- gulp
|
||||
- rm -Rf node_modules/electron-builder-squirrel-windows node_modules/electron-windows-notifications #Avoid electron fail
|
||||
|
||||
script:
|
||||
- npm run build
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"preionic:build": "gulp",
|
||||
"postionic:build": "gulp copy-component-templates",
|
||||
"desktop.pack": "electron-builder --dir",
|
||||
"desktop.dist": "electron-builder",
|
||||
"desktop.dist": "electron-builder -p never",
|
||||
"windows.store": "electron-windows-store --input-directory .\\desktop\\dist\\win-unpacked --output-directory .\\desktop\\store --flatten true -a .\\resources\\desktop -m .\\desktop\\assets\\windows\\AppXManifest.xml --package-version 0.0.0.0 --package-name MoodleDesktop"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Compile AOT.
|
||||
if [ $TRAVIS_BRANCH == 'integration' ] || [ $TRAVIS_BRANCH == 'master' ] || [ -z $TRAVIS_BRANCH ] ; then
|
||||
if [ $TRAVIS_BRANCH == 'integration' ] || [ $TRAVIS_BRANCH == 'master' ] || [ $TRAVIS_BRANCH == 'desktop' ] || [ -z $TRAVIS_BRANCH ] ; then
|
||||
cd scripts
|
||||
./build_lang.sh
|
||||
cd ..
|
||||
|
@ -38,9 +38,8 @@ fi
|
|||
# Copy to PGB git (only on a configured travis build).
|
||||
if [ ! -z $GIT_ORG ] && [ ! -z $GIT_TOKEN ] ; then
|
||||
gitfolder=${PWD##*/}
|
||||
cd ..
|
||||
git clone --depth 1 --no-single-branch https://github.com/$GIT_ORG/moodlemobile-phonegapbuild.git pgb
|
||||
cd pgb
|
||||
git clone --depth 1 --no-single-branch https://github.com/$GIT_ORG/moodlemobile-phonegapbuild.git ../pgb
|
||||
pushd ../pgb
|
||||
git checkout $TRAVIS_BRANCH
|
||||
rm -Rf assets build index.html templates
|
||||
cp -Rf ../$gitfolder/www/* ./
|
||||
|
@ -48,4 +47,10 @@ if [ ! -z $GIT_ORG ] && [ ! -z $GIT_TOKEN ] ; then
|
|||
git add .
|
||||
git commit -m "Travis build: $TRAVIS_BUILD_NUMBER"
|
||||
git push https://$GIT_TOKEN@github.com/$GIT_ORG/moodlemobile-phonegapbuild.git
|
||||
popd
|
||||
fi
|
||||
|
||||
if [ ! -z $GIT_ORG_PRIVATE ] && [ ! -z $GIT_TOKEN ] && [ $TRAVIS_BRANCH == 'desktop' ] && [ $TRAVIS_OS_NAME == 'linux' ]; then
|
||||
./scripts/linux.sh
|
||||
fi
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Script for generating the Desktop builds
|
||||
#
|
||||
|
||||
sudo apt-get install -y libnss3-dev
|
||||
|
||||
npm install -g electron-builder electron
|
||||
|
||||
electron-builder install-app-deps
|
||||
|
||||
jq -s '.[0] + {"name": "moodledesktop"}' package.json > package_new.json
|
||||
mv package_new.json package.json
|
||||
|
||||
rm -Rf desktop/dist
|
||||
|
||||
npm run desktop.dist -- -l --x64 --ia32
|
||||
|
||||
if [ ! -z $GIT_ORG_PRIVATE ] && [ ! -z $GIT_TOKEN ] ; then
|
||||
git clone -q https://$GIT_TOKEN@github.com/moodlemobile/bma-apps-builds.git ../apps
|
||||
|
||||
mv desktop/dist/*.AppImage ../apps
|
||||
|
||||
cd ../apps
|
||||
|
||||
chmod +x *.AppImage
|
||||
mv *i386.AppImage linux-ia32.AppImage
|
||||
mv Moodle*.AppImage linux-x64.AppImage
|
||||
ls
|
||||
|
||||
git add .
|
||||
git commit -m "Linux desktop versions from Travis build $TRAVIS_BUILD_NUMBER"
|
||||
git push
|
||||
fi
|
Loading…
Reference in New Issue