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

Update: add tag output to goreleaser-action #318

Closed
wants to merge 1 commit into from

Conversation

till
Copy link

@till till commented Dec 6, 2021

No description provided.

Comment on lines +52 to +56
if (isTagDirty) {
core.setOutput("tag", `${tag}-next`);
} else {
core.setOutput("tag", tag);
}
Copy link
Member

@crazy-max crazy-max Jan 14, 2022

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?

Copy link
Author

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.

Copy link
Author

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.

Copy link
Member

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...

Copy link
Member

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

Copy link
Member

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

Copy link
Author

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.

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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:

https://github.com/docker/metadata-action/blob/2cad85de2462ab92a22ff973a347fb25c91d6082/src/main.ts#L62-L67

image

what else?

The more the better 🙏

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

Successfully merging this pull request may close these issues.

None yet

3 participants