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
Update: add tag
output to goreleaser-action
#318
Conversation
if (isTagDirty) { | ||
core.setOutput("tag", `${tag}-next`); | ||
} else { | ||
core.setOutput("tag", tag); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should have -next
hardcoded like this. It should reflect the .goreleaser.yml
provided.
I wonder if somehow GoReleaser should produce a metadata file (e.g., metadata.json
) like the artifacts.json
one that contains the list of known/generated templates vars like .Version
, etc... so we could use it as a metadata
output in GitHub Actions:
-
name: Run GoReleaser
id: goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
run: |
echo "${{ fromJSON(steps.goreleaser.outputs.metadata).version }}"
Thoughts @caarlos0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would work as well. Just looking to deploy a fluent version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazy-max Btw can you point out how .goreleaser.yml
can influence the name? Wasn't aware of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks it's a good idea @crazy-max , we already do it for artifacts...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@till the snapshot name template config
And also the nightly on goreleaser pro
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, we need to add this feature to goreleaser first (e.g. a dist/context.json
) or something like that, the IMHO we can parse it here and output the values...
things I think would be useful as outputs:
- current and previous tag names and versions
- project name
- what else?
artifacts can be get from dist/artifacts.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe isDirty, or isSnapshot? Can't think of much right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, sound good, will open an issue on goreleaser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and output the values...
Yeah we just need one output named metadata
or context
that will be the JSON representation so we can use fromJSON()
in the underlying steps.
We do this in the metadata-action:
what else?
The more the better 🙏
No description provided.