-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
698c63c
to
f51e82f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.github/workflows/nightly.yaml
Outdated
git tag -a $TAG -m "$TAG: nightly build" | ||
git push origin $TAG | ||
- name: 'Clean up nightly releases' | ||
uses: dev-drprasad/[email protected] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is currently the one with the most usage it seems like and it has been abandoned fairly recently. Other alternatives have (seemingly) low usage and are very new:
https://github.com/ShivamHS/delete-tag
https://github.com/marketplace/actions/delete-a-release-by-tag-name
https://github.com/marketplace/actions/delete-stale-releases
https://github.com/marketplace/actions/delete-a-release
https://github.com/larryjoelane/delete-release-action
This is a little more hacky:
https://github.com/actions/github-script
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
c3fc122
to
ac4b561
Compare
Signed-off-by: omrishiv <[email protected]>
ac4b561
to
e454aed
Compare
Thanks for setting up the app, we should be using that correctly now |
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
Signed-off-by: omrishiv <[email protected]>
281 add nightly builds
Signed-off-by: omrishiv <[email protected]>
update envvar
Signed-off-by: omrishiv <[email protected]>
update tag finding logic
Signed-off-by: omrishiv <[email protected]>
update action version
Signed-off-by: omrishiv <[email protected]>
update action variables
Signed-off-by: omrishiv <[email protected]>
update action variables
Signed-off-by: omrishiv <[email protected]>
update action function
Signed-off-by: omrishiv <[email protected]>
update action function
Signed-off-by: omrishiv <[email protected]>
update action function
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]>
Addresses #281
Note: we need to create a repo secret called
GH_NIGHTLY_TOKEN
that has permissions to commit toidpbuilder
and publish packages. This is a GH limitation: https://github.com/orgs/community/discussions/27028#discussioncomment-3254360At 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
theroot.go
file or the release will fail.