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

Github Actions: UploadArtifact does not result in uploaded artifact #4326

Open
2 tasks done
Sebazzz opened this issue Aug 16, 2024 · 4 comments
Open
2 tasks done

Github Actions: UploadArtifact does not result in uploaded artifact #4326

Sebazzz opened this issue Aug 16, 2024 · 4 comments

Comments

@Sebazzz
Copy link

Sebazzz commented Aug 16, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake runner for .NET Core

Cake version

4.0.0

Operating system

Windows

Operating system architecture

64-Bit

CI Server

Github Actions

What are you seeing?

Artifact is not showing up at end of the build, but no exception is raised either. Simply nothing happens, as if the call to UploadArtifact isn't there.

What is expected?

Artifact appears at the end of the run

Steps to Reproduce

  • I'm running Cake through a bootstrap script, not through the cake action, for instance:
- name: Build - Publish package
   run: .\build.cmd -target package -configuration release -verbosity verbose
GitHubActions.Commands.UploadArtifact(MakeAbsolute(targetFilePath), artifactName);

with parameters:

  • targetFilePath = build/my-package-3.2.0-alpha1-gbc9a15817f.zip
  • artifactName = my-package-3.2.0-alpha1-gbc9a15817f.zip

Output log

========================================
Create-PackageZip
========================================
Executing task: Create-PackageZip
Moving directory out to D:/a/corp-my-package/corp-my-package/build/forge-out
Used branch information 'refs/heads/develop' to determine if this is a public release: False. Use the -PublicRelease parameter to override.
Executing: "D:/a/corp-my-package/corp-my-package/tools/7-Zip.CommandLine.18.1.0/tools/x64/7za.exe" a -tzip "build/my-package-3.2.0-alpha1-gfc1964d21d.zip" "D:/a/corp-my-package/corp-my-package/build/forge-out/my-package-win32-x64"
ESEF reader has been packaged to location: build/my-package-3.2.0-alpha1-gfc1964d21d.zip
Finished executing task: Create-PackageZip

@devlead
Copy link
Member

devlead commented Aug 16, 2024

It's an async method do you await it?
Example:

await GitHubActions.Commands.UploadArtifact(data.AssemblyPath, data.FileArtifactName);

@Sebazzz
Copy link
Author

Sebazzz commented Aug 16, 2024

No I don't. I didn't notice in the docs it returns a task, but it does so I guess I ignored that.

@Sebazzz Sebazzz closed this as completed Aug 16, 2024
@Sebazzz
Copy link
Author

Sebazzz commented Aug 16, 2024

Unfortunately, that brings me one step closer:

GitHub Actions Runtime Token missing

I'm not using Cake frosting. Is the Github Cake step mandatory? I'm unable to use it in my repository due to security constraints.

@Sebazzz Sebazzz reopened this Aug 16, 2024
@devlead
Copy link
Member

devlead commented Aug 16, 2024

https://github.com/cake-build/cake-action is needed as regular GitHub action script task doesn't include needed variables from the environment. For security concerns it's recommended to pin to a specific commit or you fork and reference the code to a repository controlled by your org.

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

No branches or pull requests

2 participants