# How do you automate the rclone build process

**URL:** <https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493>\
**Category:** Dev Discussions\
**Created:** [April 9, 2024, 12:14pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493 "2024-04-09T12:14:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlh](https://forum.rclone.org/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@karlh](https://forum.rclone.org/u/karlh)\
**Post date:** [April 9, 2024, 12:14pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/1 "2024-04-09T12:14:08Z")

</div>

Hello all

I have been interested in rclone for a while, and have been developing small apps in Go because I hope to one day add a feature or contribute to the source code of rclone. I have a good understanding of Go but still need to work on a few projects to expand my skillset. Go is not my first language.

I was wondering how you get so many binary builds for rclone; would love to replicate this for my projects. I was thinking about using docker (I love docker) or distrobox (not use yet) to set up a build environment via script because if I [change the Go environment](https://www.digitalocean.com/community/tutorials/building-go-applications-for-different-operating-systems-and-architectures), to say Fedora or Windows, it does not build (cannot remember error off top of my head). Therefore I am stuck with a binary built for my system - I can also create deb files; I am using Ubuntu.

 ![image](https://forum.rclone.org/uploads/default/original/3X/9/c/9c322a9bfa410dd8547ab5e573ea3f98f064413c.png)

I am not a software developer by trade -- it's a hobby. So hope this isn't too obvious!

Thank you.

---

<div class="post-metadata">

**Author:** ![albertony](https://forum.rclone.org/user_avatar/forum.rclone.org/albertony/32/8586_2.png) [@albertony](https://forum.rclone.org/u/albertony)\
**Post date:** [April 9, 2024, 1:52pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/2 "2024-04-09T13:52:51Z")

</div>

It is not too obvious, no! 🙂

But the short answer is [GitHub Actions](https://github.com/features/actions). To do multiple builds like this, the [matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) feature comes in handy.

You can dive into the full details of rclone's setup in [.github/workflows/build.yml](https://github.com/rclone/rclone/blob/master/.github/workflows/build.yml), which utilizes a [Makefile](https://github.com/rclone/rclone/blob/master/Makefile) and some other utilities.

For a regular developer, however, this is out of scope. Simple "go build" commands normally suffices. Using [VSCode](https://code.visualstudio.com) with Go extension is the definitive go-to developer setup in my opinion.

---

<div class="post-metadata">

**Author:** ![nielash](https://forum.rclone.org/user_avatar/forum.rclone.org/nielash/32/16050_2.png) [@nielash](https://forum.rclone.org/u/nielash)\
**Post date:** [April 9, 2024, 1:59pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/3 "2024-04-09T13:59:05Z")

</div>

This works beautifully for me (from the project root dir):

```auto
make compile_all

```

---

<div class="post-metadata">

**Author:** ![albertony](https://forum.rclone.org/user_avatar/forum.rclone.org/albertony/32/8586_2.png) [@albertony](https://forum.rclone.org/u/albertony)\
**Post date:** [April 9, 2024, 2:20pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/4 "2024-04-09T14:20:50Z")

</div>

Ah, right, forgot about that one (I rarely use make). That seems like the spot on one-liner answer. 🥇

---

<div class="post-metadata">

**Author:** ![karlh](https://forum.rclone.org/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@karlh](https://forum.rclone.org/u/karlh)\
**Post date:** [April 9, 2024, 3:54pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/5 "2024-04-09T15:54:19Z")

</div>

> [@albertony](#):
>
> It is not too obvious, no! 🙂
> 
> But the short answer is [GitHub Actions](https://github.com/features/actions). To do multiple builds like this, the [matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) feature comes in handy.
> 
> You can dive into the full details of rclone's setup in [.github/workflows/build.yml](https://github.com/rclone/rclone/blob/master/.github/workflows/build.yml), which utilizes a [Makefile](https://github.com/rclone/rclone/blob/master/Makefile) and some other utilities.
> 
> For a regular developer, however, this is out of scope. Simple "go build" commands normally suffices. Using [VSCode](https://code.visualstudio.com) with Go extension is the definitive go-to developer setup in my opinion.

Thanks. I will look into the build config. I may have to spend a little time learning GitHub Actions. I am already using GitHub for my projects so shouldn't be too complex to learn.

I am using VSCode too, so I will look at the Go extension too.

> [@nielash](#):
>
> This works beautifully for me (from the project root dir):
> 
> ```auto
> make compile_all
> 
> ```

Cool. I thought this was just for the C programming language. I will read about this further.

Thanks

---

<div class="post-metadata">

**Author:** ![darthShadow](https://forum.rclone.org/user_avatar/forum.rclone.org/darthshadow/32/1322_2.png) [@darthShadow](https://forum.rclone.org/u/darthShadow)\
**Post date:** [April 9, 2024, 7:11pm UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/6 "2024-04-09T19:11:52Z")

</div>

If you want something simple to get started with without needing to spend too much learning about the build process rather than the actual app, you can try using goreleaser instead. Simplifies a lot of the build process and works both locally and on CI environments.

> **[GoReleaser - Quick Start](https://goreleaser.com/quick-start/)**
>
> Deliver Go binaries as fast and easily as possible

---

<div class="post-metadata">

**Author:** ![karlh](https://forum.rclone.org/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@karlh](https://forum.rclone.org/u/karlh)\
**Post date:** [April 10, 2024, 7:30am UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/7 "2024-04-10T07:30:56Z")

</div>

Thanks for this and all input. I have a few great approaches to learn - as with everything in life, whichever is easiest and most efficient for me I will implement. Goreleaser look great.

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [April 10, 2024, 9:50am UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/8 "2024-04-10T09:50:19Z")

</div>

Goreleaser is a good shout - the rclone build process is very complicated due to needing to build on native macOS and Windows. If you don't use CGO then you can use goreleaser and your life will be a lot simpler!

I use it on a less complicated project than rclone

> **[GitHub - ncw/stressdisk: Stress test your disks / memory cards / USB sticks...](https://github.com/ncw/stressdisk)**
>
> Stress test your disks / memory cards / USB sticks before trusting your valuable data to them - ncw/stressdisk

If you want to check out how to use it look at the [RELEASE.md](https://github.com/ncw/stressdisk/blob/master/RELEASE.md) and the [.goreleaser.yaml](https://github.com/ncw/stressdisk/blob/master/.goreleaser.yaml)

Goreleaser has been a bit of a moving target over the years so that may not include the latest stuff, but it should get you going.

---

<div class="post-metadata">

**Author:** ![karlh](https://forum.rclone.org/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@karlh](https://forum.rclone.org/u/karlh)\
**Post date:** [April 15, 2024, 10:31am UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/9 "2024-04-15T10:31:11Z")

</div>

Thanks all for input.

With a little trial and error and further reading, I have successfully implemented GoReleaser. More to learn but works well at present. Also needed to manually upgrade my Go from 1.18 (in my package manager) to the latest 1.22 for things to work well.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [June 15, 2024, 6:31am UTC](https://forum.rclone.org/t/how-do-you-automate-the-rclone-build-process/45493/10 "2024-06-15T06:31:33Z")

</div>

Closed on June 15, 2024, 6:31am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
