Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Add the ability to use wildcards for uploading files. #60

Open

Description

@opussf

Allow multiple files to be uploaded, either from a list, or from wildcard expansion.

Many build systems create artifact files that do not have a name known before hand, and may want to publish multiple files.
For example, a zip filename that includes the tag, or the branch that it was created from, or even for what environment it is built for (Windows / MacOS / iOS / Android / etc.) And adding supporting files, such as an MD5 / SHA1 file, or a signature file.

This would probably require removing the 'asset_name' and 'asset_content_type' attributes to have these generated by this action.

IE:
asset_path: |
path/to/files/*.zip
path/to/files/special_file_name

Activity

  1. eine commented on Sep 4, 2020

    @eine

    Dup of #47. Ref #58.

  2. alexellis commented on Nov 3, 2020

    @alexellis

    I would also be supportive of this

    @opussf if it's of use to you, feel free to use: https://github.com/marketplace/actions/upload-release-assets

  3. Felixoid commented on Nov 3, 2020

    @Felixoid

    Hey @alexellis, looks good. Do you consider to add a way to define the tag for upload manually? Or using ${{ github.event.release }} object for it?

  4. alexellis commented on Nov 3, 2020

    @alexellis

    I would accept a PR for that 👍

  5. eyal0 commented on Jan 5, 2021

    @eyal0

    @opussf You can accomplish this by setting an environment variable and then using it?

          - run: echo "FOO=$(echo hello)" >> $GITHUB_ENV
          - name: Upload windows Release Asset
            uses: actions/upload-release-asset@v1
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            with:
              upload_url: ${{ steps.create_release.outputs.upload_url }}
              asset_path: pcb2gcode-windows/pcb2gcode-${{ env.FOO }}.tar
    

    But still, having wildcard support would be nice. It's not clear to me how you would specify multiple asset_names for multiple asset_paths.

  6. maelvls commented on Jan 6, 2021

    @maelvls

    As a workaround, I have been using @alexellis's alexellis/upload-assets. For example (see in my ci.yml):

      release:
        steps:
          - id: create_release
            uses: actions/create-release@v1
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            with:
              tag_name: ${{ github.ref }}
              release_name: ${{ github.ref }}
    
          - uses: actions/download-artifact@v2
            with:
              name: ocamlyices2
              path: ocamlyices2
    
          - uses: alexellis/upload-assets@0.2.2          # ✨✨✨
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
            with:
              asset_paths: '["./gmp/*"]'

    The actions/download-artifact@v2 action downloads the ocamlyices2 artifact into ./ocamlyices2/ folder. After downloading, the folder looks like this (you can see the artifact itself on the job page):

    ocamlyices2
    ├── ocamlyices2-v0.0.4-x86_64-apple-darwin19.6.0.tar.gz
    ├── ocamlyices2-v0.0.4-x86_64-apple-darwin19.6.0.tar.gz.sha256
    ├── ocamlyices2-v0.0.4-x86_64-unknown-linux-gnu.tar.gz
    ├── ocamlyices2-v0.0.4-x86_64-unknown-linux-gnu.tar.gz.sha256
    ├── ocamlyices2-v0.0.4-x86_64-w64-mingw32.tar.gz
    └── ocamlyices2-v0.0.4-x86_64-w64-mingw32.tar.gz.sha256
    

    Finally, the alexellis/upload-assets action uploads everything that is in ./ocanlyices2/*; the above assets now appear on the Github Release page:

    example-with-alexellis_upload-assets

  7. eyal0 commented on Jan 6, 2021

    @eyal0

    But if you have wildcards, where does the name come from? Just from the file name? What if multiple files with the same name match?

  8. maelvls commented on Jan 9, 2021

    @maelvls

    I make sure to have different file names (as shown in the screenshot above)

  9. eine commented on Jan 9, 2021

    @eine

    @eyal0, very honestly, use pyGitHub or any other library for your favourite language and write your own script/action. If you know how to code (I believe you do), doing so will be easier and less frustrating than trying to use this Action. See:

  10. eyal0 commented on Jan 9, 2021

    @eyal0

    @eine I ended up using a different action which already includes an upload feature. It uses some javascript libraries which are probably the equivalent of pyGitHub.

    (I'm using msys2 to auto-release Windows builds with dozens of dlls and with great success. Thanks for msys2-setup!)

  11. eine commented on Jan 9, 2021

    @eine

    @eyal0, all the libreries interact with the same API, so all of them are equivalent. I just referenced the Python because that's the one I'm more familiar with. The JS one is probably one of actions/toolkit#334, and that's ok too.

    (So glad to hear that!)

  12. 1-alex98 commented on Feb 16, 2021

    @1-alex98

    I now used this action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions