Skip to content

Adding nightly builds to idpbuilder#320

Merged
nabuskey merged 31 commits intocnoe-io:mainfrom
omrishiv:281-add-nightly-builds
Jul 1, 2024
Merged

Adding nightly builds to idpbuilder#320
nabuskey merged 31 commits intocnoe-io:mainfrom
omrishiv:281-add-nightly-builds

Conversation

@omrishiv
Copy link
Copy Markdown
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
Copy Markdown
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/delete-older-releases@v0.3.4
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <327609+omrishiv@users.noreply.github.com>
@omrishiv omrishiv force-pushed the 281-add-nightly-builds branch from ac4b561 to e454aed Compare June 20, 2024 20:16
@omrishiv
Copy link
Copy Markdown
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 <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
omrishiv added 8 commits June 24, 2024 12:03
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
@nabuskey nabuskey merged commit 889367a into cnoe-io:main Jul 1, 2024
@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