# How to set env vars on GitHub Actions for a Windows release?

**URL:** <https://forum.devtalk.com/t/how-to-set-env-vars-on-github-actions-for-a-windows-release/38241>\
**Category:** Backend Questions/Help\
**Tags:** github, elixir\
**Created:** [28 January 2022 15:30 UTC](https://forum.devtalk.com/t/how-to-set-env-vars-on-github-actions-for-a-windows-release/38241 "2022-01-28T15:30:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fl4m3Ph03n1x](https://forum.devtalk.com/user_avatar/forum.devtalk.com/fl4m3ph03n1x/32/3808_2.png) [@Fl4m3Ph03n1x](https://forum.devtalk.com/u/Fl4m3Ph03n1x)\
**Post date:** [28 January 2022 15:30 UTC](https://forum.devtalk.com/t/how-to-set-env-vars-on-github-actions-for-a-windows-release/38241/1 "2022-01-28T15:30:56Z")

</div>

## Background

I am trying to get a Github Action working with Windows and [Bakeware](https://github.com/bake-bake-bake/bakeware) because I am trying to create a release using it.

However, I am having issues with the environment variables.

## Code

In Bakeware’s setup page it is mentioned that we have to set the `MAKE` and `CC` environment variables:

- [GitHub - bake-bake-bake/bakeware: Compile Elixir applications into single, easily distributed executable binaries](https://github.com/bake-bake-bake/bakeware#powershell)

In my Github Action, that is exactly what I do (I think):

```auto
name: build

env:
  MIX_ENV: test
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:

  build:
    name: Build on Windows
    runs-on: windows-2019
    env: 
        CC: gcc
        MAKE: make

    steps:
    - uses: actions/checkout@v2
    - uses: erlef/setup-beam@v1
      with:
        elixir-version: '1.13.x' # Define the elixir version [required]
        otp-version: '24.2.x' # Define the OTP version [required]
    
    - name: Install choco
      shell: powershell
      run: |
        Set-ExecutionPolicy -ExecutionPolicy Bypass
        Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

    - name: Install bakeware dependencies
      shell: powershell
      run: choco install -y zstandard make mingw

    - name: Install Dependencies
      shell: powershell
      run: mix deps.get
 
    - name: Run credo code analyser
      shell: powershell
      run: mix credo --strict

```

I am even using powershell to do it (even though I am not really sure if this is needed).

## Problem

However my GitHub Actions code comes back with this error:

```auto
==> bakeware

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/launcher"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress"

mkdir: cannot create directory 'd:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress': No such file or directory

make: *** [Makefile:70: d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress] Error 1

could not compile dependency :bakeware, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile bakeware", update it with "mix deps.update bakeware" or clean it with "mix deps.clean bakeware"

** (Mix) Could not compile with "make" (exit status: 2).

```

It says it cannot compile with `make`.

## Question

I have tried copy/pasting the section:

```auto
env: 
  CC: gcc
  MAKE: make

```

To every section in that file I could think of, but I always end up with the same issue.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Fl4m3Ph03n1x](https://forum.devtalk.com/user_avatar/forum.devtalk.com/fl4m3ph03n1x/32/3808_2.png) [@Fl4m3Ph03n1x](https://forum.devtalk.com/u/Fl4m3Ph03n1x)\
**Post date:** [4 February 2022 09:19 UTC](https://forum.devtalk.com/t/how-to-set-env-vars-on-github-actions-for-a-windows-release/38241/3 "2022-02-04T09:19:48Z")

</div>

## Answer

The environment vars, in this case, were being correctly created and set. The problem was more deep, it was related to the library itself not being able to create needed folders.

Because the `make` tool used by the library needed these folders, the tool crashed itself and reported as such, thus making me believe there was an issue with my environmental setup since I was getting the error:

```auto
 (Mix) Could not compile with "make" (exit status: 2).

```

In reality however, this issue was a bug in the library, an issue that is already fixed in master:

- [Is it possible to setup a Windows Bakeware release in GitHub Actions? · Issue #127 · bake-bake-bake/bakeware · GitHub](https://github.com/bake-bake-bake/bakeware/issues/127)
