Adding nightly builds to idpbuilder#320
Conversation
698c63c to
f51e82f
Compare
nabuskey
left a comment
There was a problem hiding this comment.
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/delete-older-releases@v0.3.4 |
There was a problem hiding this comment.
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.
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.
@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.
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.
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.
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.
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.
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.
alright lets do github-script then.
c3fc122 to
ac4b561
Compare
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
ac4b561 to
e454aed
Compare
Thanks for setting up the app, we should be using that correctly now |
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>
281 add nightly builds
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update envvar
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update tag finding logic
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action version
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action variables
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action variables
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action function
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action function
Signed-off-by: omrishiv <327609+omrishiv@users.noreply.github.com>
update action function
Addresses #281
Note: we need to create a repo secret called
GH_NIGHTLY_TOKENthat has permissions to commit toidpbuilderand 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 fmttheroot.gofile or the release will fail.