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

Adding nightly builds to idpbuilder #320

Merged
merged 31 commits into from
Jul 1, 2024

Conversation

omrishiv
Copy link
Contributor

Addresses #281

Note: we need to create a repo secret called GH_NIGHTLY_TOKEN that has permissions to commit to idpbuilder and publish packages. This is a GH limitation: https://github.com/orgs/community/discussions/27028#discussioncomment-3254360

At 12 AM PST, a workflow will run that takes the latest main and pushes it as a new nightly tag. It will then delete the last nightly release. The creation of the new tag will trigger the release workflow to run which will create a new release off the nightly tag.

I also had to go fmt the root.go file or the release will fail.

@omrishiv omrishiv force-pushed the 281-add-nightly-builds branch from 698c63c to f51e82f Compare June 20, 2024 18:28
@omrishiv omrishiv linked an issue Jun 20, 2024 that may be closed by this pull request
1 task
Copy link
Collaborator

@nabuskey nabuskey left a comment

Choose a reason for hiding this comment

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

git tag -a $TAG -m "$TAG: nightly build"
git push origin $TAG
- name: 'Clean up nightly releases'
uses: dev-drprasad/[email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is no longer maintained. https://github.com/dev-drprasad/delete-older-releases

We should look for an alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

@nimakaviani @cmoulliard Any thoughts here? The GH action maintainers straight up says not to use it for new project so I would rather not use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, not great that it is not maintained, but other versions are either as old or with very little traction. if it works and since the work is already done, lets use it for now. We switch if things break. Also, it is not on the critical path for the project, so if fixing it is at the cost of losing one or two nightlies, that's fine.

Copy link
Contributor

@cmoulliard cmoulliard Jun 21, 2024

Choose a reason for hiding this comment

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

I did a quickly review and this one seems good: https://github.com/wow-actions/delete-stale-releases
Why: Their code uses the github action toolkit - https://www.npmjs.com/package/@actions/github and Github Octokit lib: https://octokit.github.io/rest.js/v20#repos-delete-release

Copy link
Contributor

Choose a reason for hiding this comment

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

yes I saw this too. latest commit is from 2 years ago. so is this any better maintained? not sure!

Copy link
Collaborator

Choose a reason for hiding this comment

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

https://github.com/actions/github-script doesn't look bad at all. All we need is get releases, parse, put new one in, delete old ones. They even provide the rest client for GH specifically. Published by GH too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't even need to put the new one; that's done by goreleaser. We just need to delete the last nightly.

Copy link
Contributor

Choose a reason for hiding this comment

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

alright lets do github-script then.

@omrishiv omrishiv force-pushed the 281-add-nightly-builds branch from c3fc122 to ac4b561 Compare June 20, 2024 20:08
Signed-off-by: omrishiv <[email protected]>
@omrishiv omrishiv force-pushed the 281-add-nightly-builds branch from ac4b561 to e454aed Compare June 20, 2024 20:16
@omrishiv
Copy link
Contributor Author

Not too sure about using PAT for orgs. Can we use this instead? https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow

Thanks for setting up the app, we should be using that correctly now

omrishiv added 22 commits June 20, 2024 15:20
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
@nabuskey nabuskey merged commit 889367a into cnoe-io:main Jul 1, 2024
5 checks passed
@omrishiv omrishiv deleted the 281-add-nightly-builds branch July 1, 2024 21:09
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.

Feature: Build idpbuilder binaries and publish them (main, PR)
4 participants