name: "VimR deps release on tag"
on:
  push:
    branches:
      - scripts
    tags:
      - 'vimr-deps-*'

jobs:
  Build-universal:
    runs-on: macos-11
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Install brew packages
        run: |
          brew install automake coreutils pyenv pyenv-virtualenv
      - name: Set up Python env
        run: |
          export PYENV_ROOT="$HOME/.pyenv"
          export PATH="$PYENV_ROOT/bin:$PATH"
          eval "$(pyenv init --path)"
          eval "$(pyenv init -)"
          eval "$(pyenv virtualenv-init -)"
          
          pyenv install 3.9.7
          pyenv virtualenv 3.9.7 com.qvacua.VimR.bin
          
          pushd bin >/dev/null
            pip install -r requirements.txt
            python setup.py develop
          popd >/dev/null
      - name: Build deps
        run: |
          ./bin/build_deps.sh
      - uses: actions/upload-artifact@v2
        with:
          name: vimr-deps
          path: bin/third_party/vimr-deps
          if-no-files-found: error
          retention-days: 1

name: "VimR deps release on tag"
on:
  push:
    branches:
      - scripts
    tags:
      - 'vimr-deps-*'

jobs:
  Build-universal:
    runs-on: macos-11
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Install brew packages
        run: |
          brew install automake coreutils pyenv pyenv-virtualenv
      - name: Set up Python env
        run: |
          export PYENV_ROOT="$HOME/.pyenv"
          export PATH="$PYENV_ROOT/bin:$PATH"
          eval "$(pyenv init --path)"
          eval "$(pyenv init -)"
          eval "$(pyenv virtualenv-init -)"
          
          pyenv install 3.9.7
          pyenv virtualenv 3.9.7 com.qvacua.VimR.bin
          
          pushd bin >/dev/null
            pip install -r requirements.txt
            python setup.py develop
          popd >/dev/null
      - name: Build deps
        run: |
          export PYENV_ROOT="$HOME/.pyenv"
          export PATH="$PYENV_ROOT/bin:$PATH"
          eval "$(pyenv init --path)"
          eval "$(pyenv init -)"
          eval "$(pyenv virtualenv-init -)"
          
          ./bin/build_deps.sh
      - uses: actions/upload-artifact@v2
        with:
          name: vimr-deps
          path: bin/third_party/vimr-deps
          if-no-files-found: error
          retention-days: 1

Set pyenv envs when building
Set pyenv envs when building
