1
0
Fork 0
mirror of https://github.com/sensebox/blockly-app synced 2025-02-20 11:53:58 +01:00

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 testing
This commit is contained in:
Norwin 2019-03-29 18:03:57 +01:00
parent 2ab13932d3
commit 7296135b56
2 changed files with 33 additions and 12 deletions

View file

@ -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

15
tools/deploy-fdroid.sh Normal file
View file

@ -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