Nightly apk releases - how to prevent a CI run from cron if repo didn't change #2276
Unanswered
vanous
asked this question in
Ask a Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a repo where step runs must be manually confirmed ("gated", as called here). Every so on, on the master branch and frequently on PR branches we manually approve the CI to see if the build compiles and tests pass.
Then, every night we build the repo and publish apks to our f-droid repo as Nightly releases. This is done via the cron feature of WP. Since 1.0, cron runs don't require approving, which is great.
What we are trying to eliminate are CI runs when the repo did not change. So far, we did not figure out a way to do this. What we do now is that in first step of the CI we check if released commit sha is the same as latest master sha, we cache this info and in all subsequent steps we check the cached info and we return 0 without building and publishing. This works reasonably well and takes about 30 seconds, but we would like to eliminate it too, to completely eliminate server usage and to not mark the CI status on the branch as OK, when in fact the build was exited before building.
We could exit as Failed during nights without the need to build, but that would teach us to skip errors in CI.
What i would like to do is, either:
during CI run, check if this version is already published. If not, build and publish and then cache this info SOMEWHERE, where we can use it in global filter, to make WP to skip the CI run. I tried to use the secrets storage, but it seems that the secrets are not available to the
when
conditions.Another option is if WP was able to exit as Skipped from the pipeline running pipeline (from what i can see, only Succeeded/Failed are available now).
I would not like to do is the "one pipeline triggers another pipeline" approach.
Any suggestions? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions