name: Release
on:
    release:
        types:
            - created

jobs:
    publish_on_win:
        runs-on: windows-latest
        steps:
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v2
            - name: Get yarn cache directory path
              id: yarn-cache-dir-path
              run: echo "::set-output name=dir::$(yarn cache dir)"
            - uses: actions/cache@v2
              id: yarn-cache
              with:
                  path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
                  key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
                  restore-keys: |
                      ${{ runner.os }}-yarn-
            - name: Install dependencies
              run: yarn install
            - name: Publish on Windows
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: yarn run publish
