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

Support for GitHub Actions and goreleaser #604

Merged
merged 9 commits into from
Jul 31, 2021

Conversation

Fontinalis
Copy link
Member

@Fontinalis Fontinalis commented Jul 29, 2021

Resolves #546 , resolves #74

What it does?

It adds a workflow for GitHub actions, which is going to trigger on new tags pushed to the repository.

Steps

  • Setup the tools used for creating a new release
    • ruby/setup-ruby@v1: required for successful gem install of the package_cloud tool
    • actions/setup-go@v2: to setup the wanted go version
    • docker/setup-qemu-action@v1 and docker/setup-buildx-action@v1 for the multi-arch build
    • docker/login-action@v1 to login to Docker Hub
  • Run GoReleaser
    • Produces packages for windows, darwin and linux
    • Builds and pushes the following Docker images
      • migrate/migrate:latest: linux/amd64 and linux/arm64
      • migrate/migrate:{{ .Major }}: linux/amd64 and linux/arm64
      • migrate/migrate:{{ .Tag }}: linux/amd64 and linux/arm64
      • migrate/migrate:{{ .Tag }}-amd64: linux/amd64
      • migrate/migrate:{{ .Tag }}-arm64: linux/arm64
    • Creates a draft release with the Changelog notes

Note: tried to push images without the -amd64 and -arm64 images, but couldn't make it work, maybe in another PR in the future.

TODOs:

The workflow requires 3 secrets to be set

  • PACKAGECLOUD_TOKEN: which is the token for Package Cloud to be able to push new packages
  • DOCKERHUB_USERNAME: the username of the docker hub user, if I'm right, it's golangmigrate for us
  • DOCKERHUB_TOKEN: which is a personal access token for the user we use to push the images

After each release / tag, someone will need to (potentially alter the notes and) publish the draft release created by GoReleaser.

Thank you @johejo for the initial work (#570 )!

@coveralls
Copy link

coveralls commented Jul 29, 2021

Pull Request Test Coverage Report for Build 523

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 57.369%

Totals Coverage Status
Change from base Build 510: 0.0%
Covered Lines: 3624
Relevant Lines: 6317

💛 - Coveralls

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for making these changes!

.goreleaser.yml Outdated Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
.goreleaser.yml Show resolved Hide resolved
.github/workflows/release.yaml Outdated Show resolved Hide resolved
@Fontinalis Fontinalis requested a review from dhui July 30, 2021 13:20
Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

We're getting close to merging this. What are your thoughts/plans for testing? Do you still have a draft of the changelog?

password: ${{ secrets.DOCKERHUB_TOKEN }}

- run: echo "::set-env name=SOURCE::$(make echo-source)"
Copy link
Member

Choose a reason for hiding this comment

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

I didn't know about workflow commands!
It looks like set-env is deprecated for security reasons. Use $GITHUB_ENV or a step output instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wow, nice catch! Fixing it right now

Copy link
Member Author

Choose a reason for hiding this comment

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

Used $GITHUB_ENV for the fix, it should be good to go. If you find something else, please let me know so I can fix it and we can get this up and running.

@Fontinalis Fontinalis requested a review from dhui July 30, 2021 17:58
@Fontinalis
Copy link
Member Author

What are your thoughts/plans for testing?

I can do a fork and test it with some test accounts.

Do you still have a draft of the changelog?

Yes, I still have it.

@Fontinalis
Copy link
Member Author

Fontinalis commented Jul 30, 2021

What are your thoughts/plans for testing?
I can do a fork and test it with some test accounts.

I already tested it (as I started my PR based on those tests). The only big change is the "single source of truth". And we could still test it by creating a v4.14.2-alpha.1 version first, and if it succeeds then go for the v4.14.2

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

We can test with beta.1 and once release are build properly, we can release a non-prerelease.
I hope specifying beta.X in the tag doesn't break downstream services like package cloud and docker hub...

@dhui dhui merged commit 5a601b9 into golang-migrate:master Jul 31, 2021
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

Successfully merging this pull request may close these issues.

Does new release is planned soon? Use GoReleaser for releases
4 participants