Skip to content

GitHub Actions: Using non-fixed names in upload-artifact #26959

Answered by managedkaos
lelegard asked this question in Actions
Discussion options

You must be logged in to vote

Yep, so it is @brunchboy!  That’s pretty cool. 😃

I’ve validated by making the following changes:

  1. Set the global VERSION environment variable in the build step after reading it from the file.
  2. Build step creates the file at the root level with the VERSION vs inside a directory.
  3. Update the workflow’s upload step to report the version in the workflow configuration and use the VERSION variable for the artifact name as well as for finding the artifact itself.

build-app.ps1; Build script:

$version = Get-Content ./version.txt -Raw
$version = $version -replace "`n|`r",""
$file = "app-" + $version + ".exe"
echo $version | Out-File $file

echo "::set-env name=VERSION::$version"

Workflow:

name: Mai…

Replies: 11 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants