name: build

on: # @see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events
  push:
    branches: # Array of patterns that match refs/heads
      - master # Push events on master branch
      - dev

jobs:
  build:
    name: Build
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@master
        with:
          lfs: false
      - name: Build
        run: |
          & git log -n 10 --pretty=oneline
          New-Item -ItemType Directory -Force ~/.npm-global
          npm config set prefix "~/.npm-global"
          if ( "${{ matrix.os }}" -eq "windows-latest" ) { 
            $ENV:PATH="~/.npm-global/bin;$ENV:PATH"
          } else {
            $ENV:PATH="~/.npm-global/bin:$ENV:PATH"
          }
          if (Test-Path "out") { Remove-Item -Recurse -Force "out" }
          & npm install -g yarn
          & yarn install --registry https://registry.npmjs.org
          & yarn run package-test --registry https://registry.npmjs.org

        shell: pwsh
      - name: Release
        uses: xresloader/upload-to-github-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          file: "out/*.7z;out/*.tar.xz"
          tags: true
          draft: true
          overwrite: true
          # verbose: true

name: build

on: # @see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events
  push:
    branches: # Array of patterns that match refs/heads
      - main # Push events on master branch
  pull_request:
    branches: [ main ]

jobs:
  build:
    name: Build
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@master
        with:
          lfs: false
      - name: Build
        run: |
          & git log -n 10 --pretty=oneline
          New-Item -ItemType Directory -Force ~/.npm-global
          npm config set prefix "~/.npm-global"
          if ( "${{ matrix.os }}" -eq "windows-latest" ) { 
            $ENV:PATH="~/.npm-global/bin;$ENV:PATH"
          } else {
            $ENV:PATH="~/.npm-global/bin:$ENV:PATH"
          }
          if (Test-Path "out") { Remove-Item -Recurse -Force "out" }
          & npm install -g yarn
          & yarn install --registry https://registry.npmjs.org
          & yarn run package-test --registry https://registry.npmjs.org

        shell: pwsh
      - name: Release
        uses: xresloader/upload-to-github-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          file: "out/*.7z;out/*.tar.xz"
          tags: true
          draft: true
          overwrite: true
          # verbose: true

Switch default branch into main
Switch default branch into main

Signed-off-by: owentou <4a3f86a245b3a1dcdb9e5eb4b64894dd9118c1d8@tencent.com>
