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

Multiple/wildcard upload #21

Open
slonopotamus opened this issue Sep 26, 2021 · 5 comments
Open

Multiple/wildcard upload #21

slonopotamus opened this issue Sep 26, 2021 · 5 comments

Comments

@slonopotamus
Copy link

Is it possible to upload multiple files in one go?

My project produces several .deb files, all of them need to be published.

Ideally, I'd like to do something like

    steps:
      - name: Publish to Cloudsmith.io
        uses: cloudsmith-io/action@master
        with:
          command: "push"
          format: "deb"
          <snip>
          file: "build/*.deb"

Even if multiple files are not supported, it is still not clear how to specify file when file name is dynamically generated (like, it contains version number in its name).

@kepstin
Copy link

kepstin commented Apr 14, 2022

The current action can't handle multiple packages at once (this is maybe something that could be added to the cloudsmith cli tool itself rather than the action?) but wildcards do work, you can do something like:

  file: debian/artifacts/package-name_*_amd64.deb

to publish a package regardless of the possibly generated version number.

You could also have a step which saves the package version to an env variable, like

- run: echo "PACKAGE_VERSION=$(dpkg-parsechangelog -S version)" >> $GITHUB_ENV

- uses: cloudsmith-io/action@master
  with:
    file: debian/artifacts/package-name_${{ env.PACKAGE_VERSION }}_amd64.deb

@maidul98
Copy link

+1 this should added

@KitsuneRal
Copy link

@kepstin Not sure it actually works the way you intended. I'm trying to pass a file retrieved by actions/download-artifact using something like ${{ steps.download-artifact.outputs.download-path }}/* for file (there's exactly one file at the path). GitHub Actions does what it should with the output part and then, judging by the build logs, the path is handed over to Cloudsmith CLI without expanding the wildcard. Not sure why that happens, actually... Bash eval should expand globs at this point, unless glob expansion is turned off. But I clearly see in the preceding echo output that the asterisk remains, as if it were escaped when passed inside the script. The relevant build logs can be found here, if you're interested.

@modem7
Copy link

modem7 commented Mar 1, 2023

Allowing for multiple files to be uploaded would be exceedingly useful.

For example, using cibuildwheel to create python wheels for multiple architectures and/or python versions would output multiple files in a single build run (e.g. https://github.com/modem7/cibuildwheel/actions/runs/4298866331), which would need to be uploaded.

Currently, I have to wait for the run to complete, download the files, and then use the cli to upload to cloudsmith, which is rather cumbersome (even more so because the CLI also doesn't support multiple files).

@JonasVautherin
Copy link

this is maybe something that could be added to the cloudsmith cli tool itself rather than the action?

Would that then translate "transparently" to the action? And do you know if there is an open issue for that, by any chance?

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

No branches or pull requests

6 participants