Comments (17)
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.
What will also be nice is to specify glob patterns too. So something like:
path:
- /releases/**/*.apk
from upload-artifact.
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:
Line 46 in 97b7dac
from upload-artifact.
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.
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.
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.
so 2022 came and went any update on this?
from upload-artifact.
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.
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.
@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.
Can anyone comment on if this is currently possible?
from upload-artifact.
can we do this yet or not?
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
paths:
- 1
- 2
- 3
from upload-artifact.
@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.
@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.
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.
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.
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)
- @v4 breaks workflows when using unprivileged containers HOT 3
- [bug] v4.3.1: Unexpected token '<', "<!DOCTYPE "... is not valid JSON HOT 9
- [feat req] support colon in file names HOT 1
- Add option to include explicit directory entries [feat req] HOT 1
- [feat req] merging of uploads ala v3 HOT 3
- Delete Artifact Action HOT 1
- #331
- [bug] Request failures in v4 on ECONNRESET and 403 Forbidden. HOT 5
- Temporary/intermediate artifacts HOT 2
- [bug] Failed to CreateArtifact: Failed to make request after 5 attempts: Request timeout HOT 2
- Rename the files after/before uploading
- [bug] Artifact overwrite doesn't always work HOT 2
- [bug]
- [bug] v3 and v4 hang 100% uploading from macos-13 runner following CPACK_GENERATOR "DragNDrop"
- Getting Dependabot Alert HOT 2
- [bug] all artifacts are not getting uploaded.
- [ci] `.github/workflows/codeql-analysis.yml` uses a `deprecated` version of `Node.js`
- [bug] Only contents of macOS-Application (***.app) get uploaded
- [bug]
- [bug] retrying a workflow causes uploaded artifacts from the previous attempt to become inaccessible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upload-artifact.