windows.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: windows_build
  2. on:
  3. schedule:
  4. - cron: '0 0 * * *'
  5. push:
  6. pull_request:
  7. branches: [ master ]
  8. jobs:
  9. windows:
  10. runs-on: windows-2016
  11. env:
  12. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  13. OS_NAME: 'windows'
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. vscode_arch: [x64, ia32, arm64]
  18. steps:
  19. - uses: actions/checkout@v2
  20. - name: Setup Node.js environment
  21. uses: actions/setup-node@v1
  22. with:
  23. node-version: 12.18.3
  24. - name: Install Yarn
  25. run: npm install -g yarn
  26. - name: Setup Python 2
  27. uses: actions/setup-python@v2
  28. with:
  29. python-version: '2.x'
  30. - name: Check PR or cron
  31. run: ./check_cron_or_pr.sh
  32. shell: bash
  33. - name: Clone VSCode repo
  34. run: ./get_repo.sh
  35. shell: bash
  36. - name: Check existing VSCodium tags/releases
  37. env:
  38. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  39. run: ./check_tags.sh
  40. shell: bash
  41. if: env.SHOULD_DEPLOY == 'yes'
  42. - name: Compute cache key
  43. id: yarnCacheKey
  44. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  45. if: env.SHOULD_BUILD == 'yes'
  46. - name: Get yarn cache directory path
  47. id: yarnCacheDirPath
  48. run: echo "::set-output name=dir::$(yarn cache dir)"
  49. if: env.SHOULD_BUILD == 'yes'
  50. - name: Cache yarn directory
  51. uses: actions/cache@v2
  52. with:
  53. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  54. key: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  55. restore-keys: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-
  56. if: env.SHOULD_BUILD == 'yes'
  57. - name: Build
  58. env:
  59. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  60. npm_config_arch: ${{ matrix.vscode_arch }}
  61. npm_config_target_arch: ${{ matrix.vscode_arch }}
  62. run: ./build.sh
  63. shell: bash
  64. if: env.SHOULD_BUILD == 'yes'
  65. - name: Move/rename build artifacts
  66. run: |
  67. mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe VSCodiumSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
  68. mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-${VSCODE_ARCH}-${LATEST_MS_TAG}.exe
  69. mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip VSCodium-win32-${VSCODE_ARCH}-${LATEST_MS_TAG}.zip
  70. shell: bash
  71. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  72. - name: Generate shasums
  73. run: ./sum.sh
  74. shell: bash
  75. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  76. - name: Release
  77. uses: softprops/action-gh-release@v1
  78. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  79. with:
  80. tag_name: ${{ env.LATEST_MS_TAG }}
  81. files: |
  82. ./*.sha256
  83. ./VSCodium*.zip
  84. ./VSCodiumUserSetup*.exe
  85. ./VSCodiumSetup*.exe
  86. env:
  87. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  88. - name: Update versions repo
  89. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  90. run: ./update_version.sh
  91. shell: bash
  92. env:
  93. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  94. GITHUB_USERNAME: ${{ github.repository_owner }}