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

Can't get file_glob to work #33

Open
ba32107 opened this issue Oct 18, 2020 · 16 comments
Open

Can't get file_glob to work #33

ba32107 opened this issue Oct 18, 2020 · 16 comments

Comments

@ba32107
Copy link

ba32107 commented Oct 18, 2020

Hi!

Thanks a lot for this action, it's very useful. I'm not sure if this is a bug or I'm doing something wrong.

Here's (part of) my workflow:

build-appimage-linux:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Build AppImage
      run: ./packaging/linux/build_appimage.sh
    - name: Upload AppImage to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ./dist/*.AppImage
        file_glob: true
        overwrite: true
        tag: ${{ github.ref }}
build-windows-packages:
    runs-on: windows-2019
    steps:
    - uses: actions/checkout@v2
    - name: Build packages
      run: ./build.bat --package
    - name: Upload installer to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: dist\*.msi
        file_glob: true  
        overwrite: true
        tag: ${{ github.ref }}
    - name: Upload portable package to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: dist\*.zip
        file_glob: true  
        overwrite: true
        tag: ${{ github.ref }}

I have two jobs, one for Windows, the other for Linux. However file_glob doesn't work for either:

1s
Run svenstaro/upload-release-action@v2
  with:
    repo_token: ***
    file: ./dist/*.AppImage
    file_glob: true
    overwrite: true
    tag: refs/tags/vsdfkllsdkfgf_companion
Error: No files matching the glob pattern found.

Run svenstaro/upload-release-action@v2
  with:
    repo_token: ***
    file: dist\*.msi
    file_glob: true
    overwrite: true
    tag: refs/tags/vsdfkllsdkfgf_companion
Error: No files matching the glob pattern found.

The working directory is definitely set correctly (because the build script themselves can be found), and the dist directory definitely exists. What am I doing wrong?

My current workaround is to use full paths, which does work:

  build-appimage-linux:
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: Build AppImage
      run: |
        source ./packaging/linux/build_appimage.sh
        echo "APPIMAGE_FULL_PATH=$_APPIMAGE_FILENAME" >> $GITHUB_ENV
    - name: Upload AppImage to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.APPIMAGE_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}
 build-windows-packages:
    runs-on: windows-2019
    steps:
    - uses: actions/checkout@v2
    - name: Build packages
      run: |
        ./build.bat --package
        $WIN_INSTALLER_FULL_PATH = (Get-ChildItem -Path dist -Filter "*.msi").Fullname
        $WIN_PORTABLE_FULL_PATH = (Get-ChildItem -Path dist -Filter "*.zip").Fullname
        echo "WIN_INSTALLER_FULL_PATH=$WIN_INSTALLER_FULL_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
        echo "WIN_PORTABLE_FULL_PATH=$WIN_PORTABLE_FULL_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
    - name: Upload installer to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.WIN_INSTALLER_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}
    - name: Upload portable package to Release
      uses: svenstaro/upload-release-action@v2
      with:
        repo_token: ${{ secrets.GITHUB_TOKEN }}
        file: ${{ env.WIN_PORTABLE_FULL_PATH }}
        overwrite: true
        tag: ${{ github.ref }}
@retorquere
Copy link

I think you don't have to escape the asterisk.

@ba32107
Copy link
Author

ba32107 commented Nov 29, 2020

That is not an escape. For example, with file: dist\*.msi I want to match any .msi file in the dist directory. Similarly, with file: ./dist/*.AppImage I am looking for .AppImage files in dist.

@ba32107
Copy link
Author

ba32107 commented Nov 29, 2020

@svenstaro, do you have any input on this issue please?

@CaptainDario
Copy link

CaptainDario commented Mar 24, 2022

@ba32107 did you find a solution?
I am encountering the same problem...

I have folder artifcats which stores my builds. This is proved by running

ls artifacts/

which results in

DaKanji_android_arm64-v7a.zip
DaKanji_android_arm64-v8a.zip
DaKanji_android_bundle.zip
DaKanji_android_x86_64.zip
DaKanji_win.msix
DaKanji_win.zip

However, when I use

- name: Upload to github releases
  uses: svenstaro/upload-release-action@v2
  with:
    repo_token: ${{ secrets.GITHUB_TOKEN }}
    file: artifacts/DaKanji_*
    file_glob: true
    tag: beta
    prerelease: true
    overwrite: true
    body: |
      IMPORTANT: this is a pre-release, you should expect some bugs 

nothing gets uploaded to my release section, only the release with the body gets created.

@retorquere
Copy link

The image ships with a pre-authenticated gh cli. Just use that in a run step.

@CaptainDario
Copy link

@retorquere thank you I will try it in the coming days

@ba32107
Copy link
Author

ba32107 commented Mar 24, 2022

@CaptainDario no I could not make it work, I'm using the workaround mentioned in my issue

@CaptainDario
Copy link

@ba32107 I ended up using the github cli, much smoother experience and more importantly it works.

@retorquere Thanks a lot for the github cli tip, works like a charm after trying for hours to get this workflow working!

@svenstaro
Copy link
Owner

Ah yes, there's been a regression with glob v8 I think. I will push a fix to master. Could you test it directly from master before I make a release?

@adrianinsaval
Copy link

@svenstaro
Copy link
Owner

Damn, I'll try to take a look soon. I think it has something to do with this: isaacs/node-glob#467

Do you perhaps have some time to work on this? I don't know when I can get to it.

@adrianinsaval
Copy link

adrianinsaval commented Jan 19, 2023

isaacs/node-glob#480 also explains it a little, seems to be just a matter of using / instead of \ , I'm testing that now https://github.com/adrianinsaval/FreeCAD-Bundle/actions/runs/3958854927/jobs/6780920316

I think this manifested also due to upgrading to node16 as this may match glob ^7 to a higher version (that already had this issue) than with node12, going back to node12 is not feasible so I think it's best to move to the current version of glob and we deal with this difference downstream

@adrianinsaval
Copy link

it was introduced here for the v7 series: isaacs/node-glob@c663c7d so since v7.2.3

@svenstaro
Copy link
Owner

Is this good for you now? Is there anything you'd suggest to change in this repo?

@adrianinsaval
Copy link

I think it's good as is, maybe add a warning that the glob pattern has to use / even on windows

TheRand0m1z3r added a commit to uri-raviv-lab/dplus-dev that referenced this issue Jun 13, 2023
…theta

in dplus-installer.yml changed '\' to '/' according to svenstaro/upload-release-action#33. Hopefully this works

Signed-off-by: Eytan Balken <eytan.balken@mail.huji.ac.il>
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

No branches or pull requests

5 participants