Run builds on new git tag

Maik Riechert's Avatar

Maik Riechert

14 Sep, 2014 10:07 AM

Hi,

first, I absolutely love your service. I'm developing a Python wrapper for a native library and without AppVeyor I would have never started to actually support Windows and build binaries for it. So, thanks that you offer this for free for open-source, it's great!

Now, to my small issue. I setup my Travis CI and AppVeyor scripts such that they deploy to PyPI whenever I push a new tag. The problem is that AppVeyor doesn't start a build when I just push a tag, whereas Travis CI does. At the moment, I work around that by manually starting a new build in AppVeyor just after I pushed the tag.

Did I miss something or is my scenario really not working currently? I thought it would be quite common to automate deployment on new version tags.

Cheers
Maik

  1. 1 Posted by James Booth on 25 Sep, 2014 03:21 PM

    James Booth's Avatar

    Hey,

    I've run into the exact same problem as Maik - any feedback on making builds-on-tag-pushes possible? A tag push is often the definitive way of saying 'a new release needs to be made', so it would be really handy if a build was automated.

    Cheers
    James

  2. 2 Posted by gep13 on 26 Sep, 2014 06:29 AM

    gep13's Avatar

    Hey,

    Seems like there is an open Issue on the GitHub Site for this enhancement, You can track it there:

    https://github.com/appveyor/ci/issues/6

    Hope that helps!

    Gary

  3. Support Staff 3 Posted by Feodor Fitsner on 02 Oct, 2014 06:47 PM

    Feodor Fitsner's Avatar
  4. 4 Posted by Maik Riechert on 02 Oct, 2014 07:02 PM

    Maik Riechert's Avatar

    That's great! Thanks for the quick implementation :)

    I'm currently using something like:

    deploy_script:
      - "powershell ./appveyor/pypi_deploy.ps1"

    And this script contains roughly:

    $gitinfo = git log -n 1 --pretty=format:'%d'
    echo "git log: $gitinfo"
    if ($gitinfo -match "tag: v") {
      # [... one more preparation line ...]
      Invoke-Expression "$env:CMD_IN_ENV python setup.py bdist_wheel upload"
    }

    I thought about putting this completely in appveyor.xml but I'm not sure
    on how to do that with deploy_script. Is it possible?

    Cheers
    Maik

  5. Support Staff 5 Posted by Feodor Fitsner on 02 Oct, 2014 07:06 PM

    Feodor Fitsner's Avatar

    To do a multi-line string in YAML with preserving new lines:

    deploy_script: |
                    line1
                    line2
                    ...
    
  6. 6 Posted by Maik Riechert on 02 Oct, 2014 07:10 PM

    Maik Riechert's Avatar

    What I meant was, can I use this part:

      on:
        branch: master
        appveyor_repo_tag: true

    in combination with deploy_script?

  7. Support Staff 7 Posted by Feodor Fitsner on 02 Oct, 2014 11:45 PM

    Feodor Fitsner's Avatar

    This is applied to deployment providers only.

    However, in your script you can just check appveyor_repo_tag variable for True.

    if($env:appveyor_repo_tag -eq 'True') {
       # do this
    }
    
  8. 8 Posted by jack.brown on 08 Oct, 2014 06:48 PM

    jack.brown's Avatar

    Is there any chance we can have deployment on tag support for BitBucket?

  9. Support Staff 9 Posted by Feodor Fitsner on 08 Oct, 2014 07:16 PM

    Feodor Fitsner's Avatar

    Will take a look.

  10. Support Staff 10 Posted by Feodor Fitsner on 08 Oct, 2014 10:04 PM

    Feodor Fitsner's Avatar

    It seems currently BitBucket does not provide the information about tags in webhook payload. Look at this: http://requestb.in/ssagxnss?inspect

    The first snapshot is regular git push where the second one is tag push.

  11. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:49 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac