How to specify wildcard artifacts subdirectories in .gitlab-ci.yml? : <p>I'm using GitLab CI to build a C# solution and try to pass some build artifacts from one build stage to another.</p>

<p>The problem is, that the artifacts are not located in a single directory but in different subdirectories, which however all have the same names <code>bin/</code> or <code>obj/</code>.</p>

<p>My <code>.gitlab-ci.yml</code> looks like the following:</p>

<pre><code>...
stages:
  - build
  - test

build:
  stage: build
  script:
    CALL %MSBuild% ...
  artifacts:
    paths:
      - /**/bin/
      - /**/obj/
    expire_in: 6 hrs

test:
  stage: test
  dependencies:
    - build
  ...
</code></pre>

<p>I tried to capture the artifacts using different ways, e.g.</p>

<pre><code>**/bin/
**/obj/
</code></pre>

<p>(invalid syntax), or</p>

<pre><code>.*/bin/
.*/obj/
</code></pre>

<p>but that one did not find any artifacts, just as <code>/**/bin/</code> and <code>/**/obj/</code>, giving me following errors:</p>

<pre><code>Uploading artifacts...
WARNING: /**/bin/: no matching files
WARNING: /**/obj/: no matching files
</code></pre>

<p><strong>How can I specify a subdirectory pattern to be scanned for artifacts? Or is this even possible at all?</strong></p>

<p>Simply using</p>

<pre><code>artifacts:
  untracked: true
</code></pre>

<p>is not an option, because of a huge untracked <code>packages/</code> subdirectory, which causes artifacts upload to fail because of a too large archive:</p>

<pre><code>Uploading artifacts...
untracked: found 4513 files                        
ERROR: Uploading artifacts to coordinator... too large archive  id=36 responseStatus=413 Request Entity Too Large token=...
FATAL: Too large
</code></pre>
