I have repo building in AppVeyor which produces some packages (.nupkg
) that are then pushed to MyGet. When I am developing on master everything is peachy, but when I'm on another branch I want it to build but NOT push packages, I have read some documentation on branches and it seems I can have one configuration for master and another for the other branches, however that would mean to duplicate all my configuration except for the line that actually pushes to MyGet. My appveyor.yml
file looks something like this:
version: 0.0.{version}
before_build:
- do some stuff (I have about 5 of these)
- ...
build_script:
- cmd: build.cmd
after_build:
- push to myGet
I would just like to run the after_build
command if is on the master
branch.
Is there a way to run some commands depending on their branch without rewriting the entire configuration for that branch (or branch type or whatever)?
You can use APPVEYOR_REPO_BRANCH
environment variable. Please try this:
after_build:
- IF %APPVEYOR_REPO_BRANCH%==master push to myGet
Ilya.