How to build and push chocolatey package with Travis CI

You can use this code for your .travis.yml:

1
2
3
4
5
6
7
8
9
10
os: windows
language: shell
branches:
  only:
  - master
script:
- choco pack path_to\\package.nuspec
after_script:
- choco apikey --key $CHOCOAPIKEY --source https://push.chocolatey.org/
- choco push

Hide your private api key in CHOCOAPIKEY secret variable. Enjoy!