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

Ability to delete local artifact after upload/download #170

Closed
2 of 6 tasks
dentuzhik opened this issue Feb 2, 2021 · 2 comments
Closed
2 of 6 tasks

Ability to delete local artifact after upload/download #170

dentuzhik opened this issue Feb 2, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@dentuzhik
Copy link

Describe the issue
This is rather a feature request.

We are using @actions/upload-artifact and @actions/download-artifact with workflows which run on self-hosted runners to build and deploy mobile applications.

Because of the way how our workflows and jobs are compositioned, build and upload jobs are separated from each other. E.g. matrixed "build jobs" run Xcode / Android Studio to produce actual deployable artifacts for different environments and upload artifacts to Github, and "upload jobs" download artifacts later on and upload them to thirdparties (App Store, Play Store, Firebase). We can have multiple upload jobs dependent on different artifacts. Looks roughly like this:
Workflow Example

It works very well on cloud machines, but as soon as some of our jobs moved to self-hosted runners space started to become an issue. Currently we just manually cleaning up artifacts from machines after uploading, but it feels like this could be a built-in functionality of the action itself.

Proposal is to add a single parameter to both @actions/upload-artifact and @actions/download-artifact, which would create a Post Run actions/upload-artifact@v2 akin to @actions/checkout, which will delete the path from which artifact was uploaded or to which it was downloaded from the local filesystem.

      - name: Upload AppStore IPA archive
        uses: actions/upload-artifact@v2
        with:
          retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
          name: ${{ env.APPSTORE_IPA_ARTIFACT_NAME }}
          path: ${{ env.APPSTORE_IPA_ARTIFACT_PATH }}
          if-no-files-found: error
          delete-local-artifact: true

This will yield ability to have completely zero-side effect invocation of both types of jobs and help with space management.
Let me know what do you think of this proposal.

Version

  • V1
  • V2

Environment

  • self-hosted
  • Linux
  • Windows
  • Mac

Screenshots
Workflow Example

Run/Repo Url
If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.

How to reproduce
If applicable, add information on how to reproduce the problem.

Additional context
Note that this is different from similar issues in this repo like #45, which want to limit artifact retention on the github servers. This is specifically the case for the local filesystem of the jobs.

@dentuzhik dentuzhik added the bug Something isn't working label Feb 2, 2021
@konradpabjan konradpabjan added duplicate This issue or pull request already exists and removed bug Something isn't working labels Feb 3, 2021
@konradpabjan
Copy link
Collaborator

Closing out as a duplicate. See: #45

@dentuzhik
Copy link
Author

Are you sure this should be closed?

I specifically mentioned that

Note that this is different from similar issues in this repo like #45, which want to limit artifact retention on the github servers. This is specifically the case for the local filesystem of the jobs.

This issue is specific to the problem of local filesystem storage, while other issue focuses on "we do not want to run out of storage on Github servers". To me these issues are completely different, and most likely will require different API to handle both cases separately.

E.g. for self-hosted machine you can have a transient artifact from the perspective of retention on Github servers (1st parameter) and to choose whether to keep it or delete it from local file system (2nd parameter).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants