Code Monkey home page Code Monkey logo

Comments (17)

Krenodeno avatar Krenodeno commented on July 27, 2024 19

It would be a very big improvement to support path like it is demonstrated here:
https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#patterns-to-match-file-paths

I'm particularly interested in the latter ones, that could look like this:

path:
  - /first/path/file.ext
  - /second/path/file.ext # take this one if the first is not found

from upload-artifact.

ShiraazMoollatjie avatar ShiraazMoollatjie commented on July 27, 2024 13

What will also be nice is to specify glob patterns too. So something like:

path:
  - /releases/**/*.apk

from upload-artifact.

konradpabjan avatar konradpabjan commented on July 27, 2024 7

not quite @zhangyoufu

If all the files are in the same working dir then it will work, however if you have a mix it will fail with Only 1 search path should be returned

Multiple search paths start to come up and that messes with the rootDirectory that gets used from the search result. I left a comment here a while back ago:

Only a single search pattern is being included so only 1 searchResult is expected. In the future if multiple search patterns are

from upload-artifact.

konradpabjan avatar konradpabjan commented on July 27, 2024 6

With v1 it is not currently possible.

v2 is right around the corner though and once it is out of preview, support can be added for multiple paths 😀

v2-preview is relying on core.getInput() to get the path input. https://github.com/actions/toolkit/tree/master/packages/core#inputsoutputs

Officially, there is no way to get multiple inputs at once from YAML (something like core.getInputs()) but there are plans to support this in the future: actions/toolkit#184

While we wait for official support, we can use a hack (similar to what @actions/cache has done) to support multiple path inputs: actions/cache#44

from upload-artifact.

zhangyoufu avatar zhangyoufu commented on July 27, 2024 6

To make it clear, you can already upload from multiple paths with \n. (the "hack" metioned above)

The path input is directly passed to actions/glob, and actions/glob supports multiple patterns separated by \n.

      uses: actions/upload-artifact@v2
      with:
        name: artifact-name
        path: |
          aaa
          bbb
          ccc

PS: actions/glob pattern is very powerful, see https://github.com/actions/toolkit/tree/master/packages/glob#patterns.

from upload-artifact.

konradpabjan avatar konradpabjan commented on July 27, 2024 5

Done! 😃

I've created a new release and updated the v2 tag so you can use the new features with actions/upload-artifact@v2

https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions

from upload-artifact.

EdwinFairchild avatar EdwinFairchild commented on July 27, 2024 4

so 2022 came and went any update on this?

from upload-artifact.

eine avatar eine commented on July 27, 2024 1

Now that #3 is published (:tada:), I guess this is the main remaining feature requested/proposed in #3 (comment):

  with:
    title: my-artifacts
      - files: [ path/to/artifact.tar.gz ]
      - name: "Packages"
        files: [ path/to/rpms/*.rpm,  path/to/debs/*.deb ]
      - name: "Docs"
        files: [ "README.md", path/to/docs, !path/to/docs/tmp ]

from upload-artifact.

ax4 avatar ax4 commented on July 27, 2024 1

can we do this yet or not?

- uses: actions/upload-artifact@v2
  with:
    name: ${{ matrix.os }}
    paths:
      - 1
      - 2
      - 3

Hi @brandonros! As PR#94 has been created 13 hours ago and merged 5 hours ago, now the multiple paths can be done (in yml/yaml file) with | creating new lines. See example at https://github.com/actions/upload-artifact/blame/master/README.md#L59-L69

Thank @konradpabjan so much for the work! Appreciate!

from upload-artifact.

eine avatar eine commented on July 27, 2024 1

@konradpabjan I'd propose some other syntax that works around the key-value limitation. For example (removing the need for name):

- uses: actions/upload-artifact@v2
  with:
       path: |
         artifact1: path/to/my_artifact.tar.gz
         artifact2: path/to/rpms/*.rpm,  path/to/debs/*.deb
         artifact3: "README.md", path/to/docs, !path/to/docs/tmp
         "artifact:subname": path/to/another.tar.gz

Although I understand that calling the action multiple times is an acceptable workaround given the constraints, I think that the UX should not be deteriorated because of incomplete implementations. Of course, it would make sense to delay such change to v3.

from upload-artifact.

jpfeuffer avatar jpfeuffer commented on July 27, 2024

Can anyone comment on if this is currently possible?

from upload-artifact.

brandonros avatar brandonros commented on July 27, 2024

can we do this yet or not?

- uses: actions/upload-artifact@v2
  with:
    name: ${{ matrix.os }}
    paths:
      - 1
      - 2
      - 3

from upload-artifact.

eine avatar eine commented on July 27, 2024

@konradpabjan thanks! It works nice!

Regarding #55 (comment) (i.e. uploading multiple paths with different names in a single call to the action), shall I open a new issue?

from upload-artifact.

konradpabjan avatar konradpabjan commented on July 27, 2024

@eine To be frank, given that we can only accept input via key value pairs, doing something with multiple name and path inputs seems impossible right now 🤔 We're just too limited with the YAML. The title part in your example for sure is not possible.

If we had support for list inputs with actions/toolkit#184, maybe we could do something like

- uses: actions/upload-artifact@v2
  with:
      name:
         - artifact1
         - artifact2
       path:
         - [ path/to/rpms/*.rpm,  path/to/debs/*.deb ]
         - [ "README.md", path/to/docs, !path/to/docs/tmp ]

but I'm not too big of a fan of this. I think it would be simpler for users to just call actions/artifact@v2 multiple times.

from upload-artifact.

kenorb avatar kenorb commented on July 27, 2024

Doesn't seems to work when uploading files from the different directories. E.g.

        uses: actions/upload-artifact@v2
        with:
          name: files
          path: |
            '*.ex?'
            '_optimize/*.set'

Issue:

Run actions/upload-artifact@v2
  with:
    name: files
    path: '*.ex?'
  '_optimize/*.set'
  
    if-no-files-found: warn
Warning: No files were found with the provided path: '*.ex?'
'_optimize/*.set'. No artifacts will be uploaded.

from upload-artifact.

rdcm avatar rdcm commented on July 27, 2024

Finally, which wildcard syntax could I use for multiple packages upload?

I have multiple NuGet packages in several directories, and I do not want to explicitly specify the path for each packet.

Current workflow yml:

- name: Upload Nuget packages
        uses: actions/upload-artifact@v2
        with:
          name: NugetPackages
          if-no-files-found: error
          path: ./**/*.nupkg

from upload-artifact.

iocmet avatar iocmet commented on July 27, 2024

Hi, can i upload all files from two folder into root of result artifact?
- name: Upload jar
uses: actions/upload-artifact@v3
with:
name: Build
path: |
Server/build/libs/*
Client/build/libs/*
Results Build.zip like: Server/build/libs/file-server.jar and Client/build/libs/file-client.jar but i need file-server.jar and file-client.jar

from upload-artifact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.