There is a bash script to upload APK
file to GitHub
repository after successful TravisCI
build.
mkdir $HOME/buildApk/
mkdir $HOME/android/
cp -R app/build/outputs/apk/app-debug.apk $HOME/android/
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "Akos Kovacs"
git clone --quiet --branch=master https://plaidshirtakos:[email protected]/plaidshirtakos/Trivia-test master > /dev/null
cd master cp -Rf $HOME/android/* .
git add -f .
git remote rm origin
git remote add origin https://plaidshirtakos:[email protected]/plaidshirtakos/Trivia-test.git
git add -f .
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed"
git push -fq origin master > /dev/null
echo "Done"
I see following lines in log.
On branch master nothing to commit, working tree clean Done
Automate building with GitHub and Build Android APK on every push to GitHub, recurrently or manually. Set up the Continuous Integration and Delivery (CI/CD) workflow with GitHub, GitHub, Build Android APK and Buddy in minutes. Build test & deploy instantly. Turn DevOps into NoOps with Buddy's automation.
On GitHub.com, navigate to the main page of the repository. Above the list of files, using the Add file drop-down, click Upload files. Drag and drop the file or folder you'd like to upload to your repository onto the file tree.
Go to File -> Settings -> Version Control -> GitHub. Enter your email and password used to create GitHub account and click on OK button. Then go to VCS -> Import into Version Control -> Share Project on GitHub. Enter Repository name, Description and click Share button.
You may miss git add command.
git add -A
-f
is "Allow adding otherwise ignored files."
-A
is "If no <pathspec> is given when -A option is used, all files in the entire working tree are updated"
Changed your sample code:
mkdir $HOME/buildApk/
mkdir $HOME/android/
cp -R app/build/outputs/apk/*.apk $HOME/android/
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "Akos Kovacs"
git clone --depth=10 --branch=master https://plaidshirtakos:[email protected]/plaidshirtakos/Trivia-test master > /dev/null
cd master
cp -Rf $HOME/android/* .
git add -A
git commit -m "Travis build $TRAVIS_BUILD_NUMBER pushed"
git push -fq origin master > /dev/null
echo "Done"
See also a sample that use ssh+git:
https://github.com/indication/OpenRedmine/blob/development/external/report.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With