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

feat: github actions support #939

Merged
merged 2 commits into from Jan 24, 2019

Conversation

Projects
None yet
4 participants
@caarlos0
Copy link
Member

caarlos0 commented Jan 24, 2019

closes #938

I'm pushing goreleaser/goreleaser:v0.98.0-action to test this...

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

the idea is to use it like this:

workflow "Release" {
  on = "push"
  resolves = ["goreleaser"]
}

action "goreleaser" {
  uses = "docker://goreleaser/goreleaser:v0.98.0-action"
  secrets = ["GITHUB_TOKEN"]
  args = "release"
}
@codecov-io

This comment was marked as outdated.

Copy link

codecov-io commented Jan 24, 2019

Codecov Report

Merging #939 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #939   +/-   ##
=======================================
  Coverage   88.31%   88.31%           
=======================================
  Files          51       51           
  Lines        2440     2440           
=======================================
  Hits         2155     2155           
  Misses        229      229           
  Partials       56       56

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60e54a1...da8af75. Read the comment docs.

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

It works!

https://github.com/caarlos0/goreleaser-action-tests/releases/tag/v1.0.0

GitHub
Contribute to caarlos0/goreleaser-action-tests development by creating an account on GitHub.
@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

Problem remaining:

  • It will run and fail if the push is not a tag
  • Icons and such seem to not be correctly detected for some reason

image

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

cc/ @jessfraz

@goreleaser goreleaser deleted a comment from codecov-io Jan 24, 2019

@goreleaser goreleaser deleted a comment from codecov-io Jan 24, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 24, 2019

Codecov Report

Merging #939 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #939   +/-   ##
=======================================
  Coverage   88.31%   88.31%           
=======================================
  Files          51       51           
  Lines        2440     2440           
=======================================
  Hits         2155     2155           
  Misses        229      229           
  Partials       56       56

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60e54a1...dd00ed9. Read the comment docs.

@jessfraz

This comment has been minimized.

Copy link

jessfraz commented Jan 24, 2019

whoa awesome!

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

@jessfraz any advice on how to run it only on tags? also, how to fix the icon and etc?

@jessfraz

This comment has been minimized.

Copy link

jessfraz commented Jan 24, 2019

I did something like this:

action "tag-filter" {
  needs = ["env"]
  uses = "docker://alpine"
  args = ["sh", "-c", "echo $GITHUB_REF | grep -Eq refs/tags.*"]
}

on on = "push"

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

Awesome, that was somewhat what I had in mind, kind of hopping there was a native way... this should work anyway :D

thanks

@jessfraz

This comment has been minimized.

Copy link

jessfraz commented Jan 24, 2019

yeah we got a lot of feedback on that and are making it better :)

@jessfraz

This comment has been minimized.

Copy link

jessfraz commented Jan 24, 2019

let me know if you all think of other improvements as well!

@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 24, 2019

yeah we got a lot of feedback on that and are making it better :)

that's awesome!

The problem with the tag filter thing is that it still exits 1, so, still looks like an error... since goreleaser already refuses to run agains a untagged commit, I'll just leave goreleaser for now...

it would be awesome if I could something like

workflow "Release" {
  on = "tag-push"
  resolves = ["goreleaser"]
}

or something like that.

anyway, thanks for the help, I think this will already make it possible to use goreleaser as a github action so it's a happy day 🚀

@jessfraz

This comment has been minimized.

Copy link

jessfraz commented Jan 24, 2019

@caarlos0 caarlos0 changed the title WIP: feat: github actions support feat: github actions support Jan 24, 2019

@caarlos0 caarlos0 merged commit b83fdd8 into master Jan 24, 2019

5 checks passed

WIP Legacy commit status override — see details
Details
codecov/patch Coverage not affected when comparing 60e54a1...dd00ed9
Details
codecov/project 88.31% remains the same compared to 60e54a1
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@caarlos0 caarlos0 deleted the github-actions branch Jan 24, 2019

@href

This comment has been minimized.

Copy link

href commented Jan 25, 2019

Wouldn't the tag filter be something one would normally use the official GitHub actions repository for?
https://github.com/actions/bin/tree/master/filter

action "is-tagged" {
  uses = "actions/bin/filter@master"
  args = "tag"
}

This could be required by the goreleaser action:

action "goreleaser" {
  uses = "docker://goreleaser/goreleaser:v0.98.0-action"
  secrets = ["GITHUB_TOKEN"]
  args = "release"
  needs = "is-tagged"
}

Still trying to learn more about actions, so this may or may not be pertinent to this issue 😅

GitHub
A collection of utilities for developing and running GitHub Actions - actions/bin
@caarlos0

This comment has been minimized.

Copy link
Member Author

caarlos0 commented Jan 25, 2019

that's interesting, will definitely give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.