Hey folks, just installed Drone today and am working on porting over a GitHub Actions workflow. I’m a bit confused about how to model some things, and whether or not I can make my work any easier.
I’m building a game. My current workflow looks like this:
- On push to master, run
cargo checkto make sure the code is at least valid. Run the check on Linux, Windows, and macOS.
- On push to release, create release builds on Linux, Windows, and macOS. Then, only if those three release builds finish, publish all three artifacts at once.
I recognize there’s a bit of friction with caching pipeline artifacts and passing them to the publish pipeline, but I want to check my understanding of how Drone is structured. For the master check, I’m guessing I’ll need three separate pipelines. Linux will run in Docker, while Windows/macOS will run in exec runners. The release step will also need three pipelines, and then a fourth to aggregate the results of the first three. Is that accurate? I was initially hoping I could somehow conditionally execute pipeline steps based on platform, to run some things in Docker or on exec runners and just swap out the steps. But that doesn’t look possible.
Assuming I’m correct, how do I perform the release aggregation such that the individual platform release pipelines are all or nothing? Essentially, each platform release build would create and cache its release, and the final pipeline would retrieve that cache and publish.
Finally, I have lots of duplication in these steps. In particular, installing Linux dependencies is identical in all pipelines, as is the basic build/check procedure. Is there any way to simplify this with anchors? For instance:
--- kind: pipeline type: docker name: check linux trigger: branch: master clone: disable: true steps: - name: clone image: alpine/git commands: - apk add --no-cache git-lfs - git clone --recursive $DRONE_REPO_LINK . - git checkout $DRONE_COMMIT
Those clone steps are identical to every pipeline, and the Linux installation steps are needed across Linux pipelines. Can I break those out into anchors so I’m not having to fix these processes in half a dozen places if they ever change?
Thanks a bunch.