diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c57dfb9..f0965168 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,6 +58,14 @@ defs: && mkdir "/tmp/arduino-cli" \ && cp "$HOME/arduino-cli" "/tmp/arduino-cli/arduino-cli" + step-install-arduino-cli-on-windows: &step-install-arduino-cli-on-windows + name: Install arduino-cli + command: | + curl -L -s --create-dirs -o "$HOME/arduino-cli.zip" "https://github.com/arduino/arduino-cli/releases/download/0.12.0/arduino-cli_0.12.0_Windows_64bit.zip" \ + && unzip "$HOME/arduino-cli.zip" -d "$HOME" \ + && cp "$HOME/arduino-cli.exe" "./packages/xod-client-electron/arduino-cli.exe" + shell: bash + step-install: &step-install name: Install Node modules # to always instal some essential tools(electron-builder etc) @@ -156,16 +164,13 @@ jobs: command: git config --global core.autocrlf input - run: command: git config --system core.longpaths true + - checkout - run: name: Install yarn command: npm install yarn@1.22.10 -g - - checkout - run: name: Install Node modules command: yarn - - run: - name: Install Node modules - command: yarn build - run: *step-build - run: name: Verify that previous step made no side-effects @@ -257,6 +262,41 @@ jobs: - "*.dmg" - "*.zip" + dist-windows: + executor: + name: win/default + steps: + - run: + command: git config --global core.autocrlf input + - run: + command: git config --system core.longpaths true + - checkout + - run: + name: Install yarn + command: npm install yarn@1.22.10 -g + - run: *step-install-arduino-cli-on-windows + - run: + name: Install Node modules + command: yarn + - run: + name: Bump version + command: | + if [[ $CIRCLE_BRANCH =~ ^prerelease-(patch|minor)- ]]; then + yarn lerna publish --skip-git --skip-npm --canary --cd-version ${BASH_REMATCH[1]} --yes + fi + shell: bash + - run: + name: Build electron IDE distro + command: NODE_ENV=production yarn build:electron && yarn dist:electron + shell: bash + no_output_timeout: 30m + - persist_to_workspace: + root: packages/xod-client-electron/dist + paths: + - latest.yml + - "*.exe" + - "*.blockmap" + #-------------------------------------------------------------------- # Upload distros job #-------------------------------------------------------------------- @@ -366,11 +406,15 @@ workflows: filters: *release-filters - dist-macos: filters: *release-filters + - dist-windows: + filters: *release-filters - upload-distros: filters: *release-filters requires: - verify-linux - verify-macos + - verify-windows - test-cpp - dist-linux - - dist-macos \ No newline at end of file + - dist-macos + - dist-windows diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 68623d31..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -image: Visual Studio 2017 - -version: '{build}' - -platform: -- x64 - -clone_depth: 5 -cache: -- '%LOCALAPPDATA%\Yarn' -- '%USERPROFILE%\.electron' -- node_modules - -init: -- git config --global core.autocrlf input -- git config --system core.longpaths true - -install: -- ps: Install-Product node 12 x64 -- npm install yarn@1.22.10 -g -- yarn cache clean -- yarn install --force -- ps: . .\tools\install-arduinocli.ps1 - -build_script: -- yarn run build -- ps: . .\tools\appveyor.ps1 - -test: off diff --git a/tools/appveyor.ps1 b/tools/appveyor.ps1 deleted file mode 100644 index 017c538a..00000000 --- a/tools/appveyor.ps1 +++ /dev/null @@ -1,33 +0,0 @@ - -function Upload-Dist-To-GCS($tag) { - $config = New-TemporaryFile - echo $env:GOOGLE_CLOUD_STORAGE_CONFIG | node -e "console.log(new Buffer ('$env:GOOGLE_CLOUD_STORAGE_CONFIG', 'base64').toString('utf8').trim())" > $config - (Get-Content -Path $config) | %{ $_.Replace("\xEF\xBB\xBF", "") } | Set-Content -Path $config - foreach ($file in (Get-ChildItem -Path packages/xod-client-electron/dist -File)) { - node tools/electron-upload.js --config=$($config.FullName) --file=$($file.FullName) --tag=$tag - } -} - -function Build-Dist() { - # Build again with production settings for the UI part of the IDE - $env:NODE_ENV="production" - yarn run build:electron - yarn run dist:electron -} - -$tags=(git tag --points-at $env:APPVEYOR_REPO_COMMIT) - -if ($tags) { - Build-Dist - foreach ($tag in $tags) { - Upload-Dist-To-GCS $tag - } -} - -if ($env:APPVEYOR_REPO_BRANCH -match '^prerelease-(patch|minor)-') { - Write-Host 'Building prerelease distributive...' -ForegroundColor Yellow - yarn lerna publish --skip-git --skip-npm --canary --cd-version $Matches[1] --yes - $tag=(node -e "console.log('v' + require('./packages/xod-client-electron/package.json').version)") - Build-Dist - Upload-Dist-To-GCS $tag -} diff --git a/tools/electron-upload.js b/tools/electron-upload.js deleted file mode 100644 index 7a7cb596..00000000 --- a/tools/electron-upload.js +++ /dev/null @@ -1,29 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -const docopt = require('docopt'); -const path = require('path'); -const storage = require('@google-cloud/storage'); - -const options = docopt.docopt(` -Uploads a release file to 'releases.xod.io' GCS bucket under tag directory. -Usage: electron-upload --config= --file= --tag= -`); -const resolve = path.resolve.bind(path, process.cwd()); -const keyFilename = resolve(options['--config']); -const file = resolve(options['--file']); -const tag = options['--tag']; -const basename = path.basename(file); - -storage({ keyFilename }) - .bucket('releases.xod.io') - .upload(file, { - destination: `${tag}/${basename}`, - metadata: { - contentDisposition: `attachment; filename="${basename}"`, - }, - public: true, - }) - .catch(error => { - // eslint-disable-next-line no-console - console.error(error); - process.exit(1); - }); diff --git a/tools/install-arduinocli.ps1 b/tools/install-arduinocli.ps1 deleted file mode 100644 index d94fbb40..00000000 --- a/tools/install-arduinocli.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -# Install arduino-cli - -Invoke-RestMethod -Uri "https://github.com/arduino/arduino-cli/releases/download/0.12.0/arduino-cli_0.12.0_Windows_64bit.zip" -Method GET -OutFile "$env:HOME/arduino-cli.zip" -unzip "$env:HOME/arduino-cli.zip" -d "$env:HOME" -copy "$env:HOME/arduino-cli.exe" "./packages/xod-client-electron/arduino-cli.exe" - -$env:XOD_ARDUINO_CLI="$env:HOME/arduino-cli.exe"