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

ci: add sdist with vendor for release workflow #797

Closed
wants to merge 1 commit into from

Conversation

arthurzam
Copy link

OK, this is the first part for #793, the simplest one. This job will create a useful for distributions source tarball, which contains the code & go mod vendor run inside.

Required setup in configuration:

  1. Go to repository settings.
  2. In left sidebar choose "Environments"
  3. Click on add new environment
  4. name it release (this is the name I used here, you can choose another one and I'll modify it here)
  5. I recommend to setup Required reviewers and add yourself in there. When you create a new tag, you'll receive an email where you need to approve the run. It helps with accidental tag push before everything is pushed :)
  6. Click on "Save protection rules"

Workflow explanation:

  1. Triggered automatically (after approval) when you push tags that start with v, for example v1.51.0.
  2. checkouts and setups go1.19
  3. runs go mod vendor
  4. create a .tar.gz file containing a directory named redis_exporter-v${version}, under which all content is found including vendor/ dir.
  5. Create a new release on github, adds as asset the sdist, marks the release as draft. This is done so you can once again verify it, add release notes (for example changelog) and then manually publish.

I've tested this workflow on my fork, it generated this file redis_exporter-0.0.9999.tar.gz (yes, I used quite weird version)

My next step

Add another job to this workflow, which would build the binaries, and add them as assets to the same draft release.

@coveralls
Copy link

coveralls commented May 9, 2023

Pull Request Test Coverage Report for Build 383

Details

  • 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 83.947%

Totals Coverage Status
Change from base Build 379: 0.0%
Covered Lines: 1982
Relevant Lines: 2361

💛 - Coveralls

@oliver006
Copy link
Owner

Thank you for the PR! ❤️
I'm really slammed this week but will hopefully get to reviewing it, probably by the end of this week or next, sorry about the delay.

@arthurzam
Copy link
Author

ping?

@oliver006
Copy link
Owner

ping?

I'm so sorry, I totally messed up and didn't get to reviewing this PR.
I'll try to find some time over the next 1-2 weeks to look at this and review it.
Again, my apologies.

@arthurzam
Copy link
Author

ping?

@oliver006
Copy link
Owner

My sincere apologies, I never got to reviewing this and should have updated this PR sooner.
I'm still super swamped with work and other stuff but I'll get this reviewed as I think it'd be great to remove the reliance on the old drone system (no matter how well it works right now, it'll break eventually and won't be fixable).

Copy link
Owner

@oliver006 oliver006 left a comment

Choose a reason for hiding this comment

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

Looks good!
Few minor changes and then step 1 should be ready to go.

Thanks for your patience with this!

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@oliver006
Copy link
Owner

I created the release env per your instructions, thanks for adding that much detail, that helped.

I got a question re: Triggered automatically ... when you push tags that start with v... and what the new release workflow looks like.

Right now I create a new release by clicking "Draft a new release" on the releases page, pick a tag and title, and then fill out the details, done.
This new flow now requires me to tag via git CLI and push the tag or is there a way to create just a tag (without a release) in the Github UI? I'm totally fine with using the CLI, it's more about knowing what the future release flow looks like.

@arthurzam
Copy link
Author

I created the release env per your instructions, thanks for adding that much detail, that helped.

Great, thanks.

I got a question re: Triggered automatically ... when you push tags that start with v... and what the new release workflow looks like.

Right now I create a new release by clicking "Draft a new release" on the releases page, pick a tag and title, and then fill out the details, done. This new flow now requires me to tag via git CLI and push the tag or is there a way to create just a tag (without a release) in the Github UI? I'm totally fine with using the CLI, it's more about knowing what the future release flow looks like.

Yes, it would be better to use a git CLI tool to push those tags. You would be also be able to GPG sign the release, which is a great way to give confidence for consumers in the release was indeed by you.


on:
push:
tags: [tst-v*, v*]
Copy link
Owner

Choose a reason for hiding this comment

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

Please only tst-v* for now, I don't want this flow to interfere (or break) the real release flow. We'll cut this over when we have confirmed that this is working and ready for prime time.

.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
@oliver006 oliver006 closed this Sep 9, 2024
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.

3 participants