version: 1.0.{build}
environment:
    nodejs_version: 16.13
install:
    # Get the latest stable version of Node.js or io.js
    - ps: Install-Product node $env:nodejs_version
    # install modules
    # - npm ci
    - corepack enable
    - yarn install --network-concurrency 1 --frozen-lockfile
build: off
platform:
    - x64
before_package: echo Before package
after_test:
    - 7z a build\html5_history_dist_%APPVEYOR_REPO_TAG_NAME%.zip %APPVEYOR_BUILD_FOLDER%\build\dist -r
    - 7z a build\hash_history_dist_%APPVEYOR_REPO_TAG_NAME%.zip %APPVEYOR_BUILD_FOLDER%\build\hash-history -r
    - node ./write_digest.js
test_script:
    - npm run package
    - npm run build
    - npm run build-hash
artifacts:
    - path: build\binaries\*.exe
      name: WindowsApp
    - path: build\html5_history_dist_*.zip
      name: html5_history_dist
    - path: build\hash_history_dist_*.zip
      name: hash_history_dist
    - path: build\release-checksums-*
      name: release-checksums-windows
deploy:
    provider: GitHub
    release: $(APPVEYOR_REPO_TAG_NAME)
    description: "Automated release from Travis CI with added files from AppVeyor build"
    auth_token:
        secure: uS05GMpB0YT6PxlANXE0RK4+QMcgVIzza/sq8FooNp6Qt0cLcxrtbf8FwslpRg5I
    artifact: WindowsApp, html5_history_dist, hash_history_dist, release-checksums-windows
    draft: true
    force_update: true
    on:
        appveyor_repo_tag: true
