Releasing macOS app on GCP — Part 2

Margaryta Chepiga
Tumiya
Published in
4 min readDec 30, 2019

This is the second part of the series, you can find the rest below:

Now next step is to automate the process of uploading your app from Bitrise to the bucket. In order to do that, you need to set up several things.

Which are:

  • Create/Update workflow on Bitrise
  • If you are creating a new workflow, you need to make changes in Gitlab to call the new Bitrise workflow

On the Bitrise page, click on Workflow:

This will lead you to all of your workflows, from there click on + Workflow to create a new workflow:

As you know, the pop up window will come up, give your new workflow a name, and click on Done button:

Great!

Now, let’s add the steps to our workflow.

We will need the following steps:

  • Activate ssh key
  • Bitrise Cache pull
  • And two script steps that we will write together

Add those steps, and we will configure them together.

If you set up your Bitrise and your GitLab project before (I assume so), you don’t need to change anything in the Activate SSH Keys.

Bitrise Cache Pull

You need this step to pull your app archive from the previous step where you do a build for your project. Therefore, you need to add a Cache Push step in your building workflow.

Let’s do that first. Save your changes before proceeding.

This is how my building workflow looks like:

Important steps here are Archive for Mac and Cache Push.

Archive for Mac
You don’t need to change anything in this step, but you need an executable of your app in order to release it.

Cache Push

Here, we do need to do some set up. You need to provide the path of your executable. You can find out your app executable by looking at logs while you run Archive for Mac step.

Then, all you need to do, is to paste that in the Cache Path. In my case, it looks like this:

That was all the set up needed for the Cache Pull. Make sure to save your changes and we are good to switch to your release_on_gcp workflow.

Script #1

This is probably the hardest part of this tutorial. See, in order to push to the gcp bucket, we need to install gcloud command-line tool on Bitrise. Using which we can easily upload app executable to the cloud bucket.

In newer versions of the stack, you might already have gcloud installed. The stack I use doesn’t have it, therefore I have to install it myself.

If you don’t know where your stack has it, let me show you how you can check:

Click on Stack:

It will bring you to the stack page, from where you should click on More Information about this stack:

It will bring you the Bitrise repo on Github, where you can simply look though the file to see whether gcloud is installed:

If you have the same stack as I do, don’t bother, it doesn’t have gcloud there.

But if you do, you are lucky. This tutorial, however, is not for lucky people. Which means, that we will have to install gcloud ourselves.

To see how you can do that, proceed to the next part of these tutorial series.

--

--

Margaryta Chepiga
Tumiya
Writer for

Software Developer, known as overexcited girl who is passionate about technology