Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _rg.ps1 to windows zip #401

Merged
merged 1 commit into from
Mar 9, 2017
Merged

Add _rg.ps1 to windows zip #401

merged 1 commit into from
Mar 9, 2017

Conversation

dstcruz
Copy link
Contributor

@dstcruz dstcruz commented Mar 9, 2017

Tested with local cargo build paths.

Tested with local cargo build paths.
@dstcruz
Copy link
Contributor Author

dstcruz commented Mar 9, 2017

Apologies for the extra hassle.

@BurntSushi
Copy link
Owner

No worries! This looks good. If something goes wrong at the next release I will deal with it. Thank you for doing the leg work on this. :-)

@BurntSushi BurntSushi merged commit d570f78 into BurntSushi:master Mar 9, 2017
@dstcruz dstcruz deleted the patch-1 branch March 9, 2017 14:58
@BurntSushi
Copy link
Owner

Sadly, I had to revert this because it didn't actually work. I don't have time at the moment to figure out how to do globbing on Windows, but apparently the obvious thing doesn't work? See logs here: https://ci.appveyor.com/project/BurntSushi/ripgrep/build/1.0.341/job/7o1jqicmtwm7oa00

@dstcruz
Copy link
Contributor Author

dstcruz commented Mar 13, 2017

Ugh. That glob worked on my Win7 machine using Powershell. I'll take a look at the referenced URL to see if I can determine what went wrong.

@BurntSushi
Copy link
Owner

@dstcruz Thanks. :-) I will also eventually look into it, but it's such a pain to debug and I was trying to hurry off to bed last night. :-)

@leafgarland
Copy link
Contributor

Appveyor by default runs cmd scripts and cmd copy will not do directory globbing.

Powershell copy will do directory globbing and you can ask appveyor to run a line as powershell by prepending ps: to the command line:

before_deploy:
  # Generate artifacts for release
  # TODO(burntsushi): How can we enable SSSE3 on Windows?
  - cargo build --release
  - mkdir staging
  - copy target\release\rg.exe staging
  - ps: copy target\release\build\ripgrep-*\out\_rg.ps1 staging
  - cd staging
  - # release zipfile will look like 'rust-everywhere-v1.2.3-x86_64-pc-windows-msvc'
  - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip *
  - appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip

I have tested the above on my own appveyor build and it works as expected.

If you wanted to run the whole script in powershell then you can use this syntax (note the environment variables have been changed to use powershell syntax):

before_deploy:
  # Generate artifacts for release
  # TODO(burntsushi): How can we enable SSSE3 on Windows?
  - ps: |
    cargo build --release
    mkdir staging
    copy target\release\rg.exe staging
    copy target\release\build\ripgrep-*\out\_rg.ps1 staging
    cd staging
    # release zipfile will look like 'rust-everywhere-v1.2.3-x86_64-pc-windows-msvc'
    7z a "../$($env:PROJECT_NAME)-$($env:APPVEYOR_REPO_TAG_NAME)-$($env:TARGET).zip" *
    appveyor PushArtifact "../$($env:PROJECT_NAME)-$($env:APPVEYOR_REPO_TAG_NAME)-$($env:TARGET).zip"

@leafgarland
Copy link
Contributor

It was quicker to make the PR than edit the above post 😄

See #408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants