add travis deploy task for fdroid #5
pushes build result of platforms/android to `fdroid` branch, so fdroid can build using a standard gradle project. TODO: re-enable `on: tags` build option after testingios
parent
2ab13932d3
commit
7296135b56
@ -1,22 +1,28 @@
|
||||
language: node_js
|
||||
language: android
|
||||
node_js:
|
||||
- "8"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
before_script:
|
||||
- npm install
|
||||
- npm install -g ionic cordova
|
||||
|
||||
script:
|
||||
- npm run build
|
||||
- npm run android:build
|
||||
|
||||
deploy:
|
||||
provider: pages
|
||||
skip-cleanup: true
|
||||
github-token: $GITHUB_TOKEN
|
||||
keep-history: true
|
||||
on:
|
||||
tags: true
|
||||
local_dir: www
|
||||
# deploy web build to gh-pages branch
|
||||
- provider: pages
|
||||
skip-cleanup: true
|
||||
github-token: $GITHUB_TOKEN
|
||||
keep-history: true
|
||||
#on:
|
||||
# tags: true
|
||||
local_dir: www
|
||||
|
||||
# deploy android project for fdroid builds
|
||||
- provider: script
|
||||
script: bash tools/deploy-fdroid.sh
|
||||
skip-cleanup: true
|
||||
#on:
|
||||
# tags: true
|
||||
|
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# expects travis env vars: $repo, $tag, $rev, $GITHUB_TOKEN
|
||||
|
||||
target=https://$GITHUB_TOKEN@github.com/sensebox/blockly-app.git
|
||||
branch=fdroid
|
||||
|
||||
git clone --depth=1 -b $target $repo fdroid
|
||||
rm -rf fdroid/*
|
||||
mv -f platforms/android fdroid/
|
||||
cd fdroid
|
||||
git config user.name "Travis-CI"
|
||||
git config user.email "travis@travis-ci.org"
|
||||
git add -f --ignore-errors .
|
||||
git commit -m "android project for $tag at $rev" --amend # dont add new commits to avoid increasing repo size
|
||||
git push -f $target $branch > /dev/null 2>&1 # hide output to not leak GITHUB_TOKEN in logs
|
Loading…
Reference in New Issue