-
Notifications
You must be signed in to change notification settings - Fork 455
Draft
Conversation
@Emilgardis
Emilgardis
added
the
meta
issues/PRs related to the maintenance of the crate.
label
Oct 3, 2022
Member
Author
there's some things that need to be heavily considered here, as there is a risk of spinning infinite workflows when using a deploy key (the reason why that workaround is needed, i.e it should not be easy to accidentally have a workflow trigger itself or other workflows over and over).
The publish job + build
The publish job is triggered in five cases. All of these need the event to be a push (since the build job is a need for publish, and that need is gated on if: github.event_name == 'push')
- on the default_branch, or
mainin our case - on the
stagingbranch - on the
trybranch - on branches matching
v*.*.* - on tags matching
v*.*.*
In default_branch/main
In the case of main, the workflow does the following.
buildbuilds and publishes images for these targets with the tagmainandedge. It also assembles binaries for artifacting- If all ok, the
publishjob triggers - this calls
cargo xtask ci-job releasewhich- inspects the package version
- if the version does not exist as a tag, create a new tag for that version and push it.
this tag will trigger theCIworkflow again, but withref_type == "tag"
if the version does exist, exit quietly.
publishnow callscargo-publishwhich creates a new release with draft tagUnreleased, attaches binaries from step 1, and does acargo publish --dry-run, this tag uses the standard github token for workflows, and should not be able to trigger any other workflows.
In staging / try branch
In staging or try, we need to make sure that nothing goes out.
This includes tags, releases and cargo publish
buildbuilds (but does not publish) images for these targets with the tagtry/staging. It also assembles binaries for artifacting- If all ok, the
publishjob triggers - this calls
cargo xtask ci-job releasewhich- inspects the package version
- if the version does not exist as a tag, "dry-run" creating the tag and push it.
if the version does exist, exit quietly.
publishnow callscargo-publishwhich does acargo publish --dry-run
On branches matching v*.*.*
buildbuilds (but does not publish) images for these targets with the tagvx.y.zandedge. It also assembles binaries for artifacting- If all ok, the
publishjob triggers - this calls
cargo xtask ci-job releasewhich- inspects the package version
- since the
ref_type == "branch", if the version does not exist as a tag,
create a new tag for that version and push it.
this tag will trigger theCIworkflow again, but withref_type == "tag"
if the version does exist, exit quietly.
publishnow callscargo-publishwhich does nothing
On tags matching v*.*.*
In this case, we need to make sure that the created release does not trigger a workflow.
buildbuilds and publishes images for these targets with the tagvx.y.z. It also assembles binaries for artifacting- If all ok, the
publishjob triggers - this calls
cargo xtask ci-job releasewhich- inspects the package version
- since the
ref_type == "tag", the program exits quietly.
publishnow callscargo-publishwhich creates a new release with tagvx.y.z, attaches binaries from step 1, and does acargo publish, this release tag uses the standard github token for workflows, and should not be able to trigger any other workflows.
@Emilgardis
Emilgardis
force-pushed
the
rel-down
branch
from
October 4, 2022 09:58
df794cd to
03891a3
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
resolves #1050