windows.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: windows_build
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: '0 0 * * *'
  6. push:
  7. pull_request:
  8. branches: [ master ]
  9. jobs:
  10. windows:
  11. runs-on: windows-2019
  12. defaults:
  13. run:
  14. shell: bash
  15. env:
  16. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  17. OS_NAME: 'windows'
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. vscode_arch:
  22. - x64
  23. - ia32
  24. - arm64
  25. steps:
  26. - uses: actions/checkout@v3
  27. - name: Setup Node.js environment
  28. uses: actions/setup-node@v3
  29. with:
  30. node-version: 16
  31. - name: Install Yarn
  32. run: npm install -g yarn
  33. - name: Setup Python 3
  34. uses: actions/setup-python@v3
  35. with:
  36. python-version: '3.x'
  37. - name: Clone VSCode repo
  38. run: ./get_repo.sh
  39. - name: Check PR or cron
  40. run: ./check_cron_or_pr.sh
  41. - name: Check existing VSCodium tags/releases
  42. env:
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  44. run: ./check_tags.sh
  45. if: env.SHOULD_DEPLOY == 'yes'
  46. - name: Compute cache key
  47. id: yarnCacheKey
  48. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  49. if: env.SHOULD_BUILD == 'yes'
  50. - name: Get yarn cache directory path
  51. id: yarnCacheDirPath
  52. run: echo "::set-output name=dir::$(yarn cache dir)"
  53. if: env.SHOULD_BUILD == 'yes'
  54. - name: Cache yarn directory
  55. uses: actions/cache@v3
  56. with:
  57. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  58. key: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  59. restore-keys: ${{ env.OS_NAME }}-${{ env.VSCODE_ARCH }}-yarnCacheDir-
  60. if: env.SHOULD_BUILD == 'yes'
  61. - name: Build
  62. env:
  63. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  64. npm_config_arch: ${{ matrix.vscode_arch }}
  65. npm_config_target_arch: ${{ matrix.vscode_arch }}
  66. run: ./build.sh
  67. if: env.SHOULD_BUILD == 'yes'
  68. - name: Prepare artifacts
  69. run: ./prepare_artifacts.sh
  70. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  71. - name: Release
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. run: ./release.sh
  75. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  76. - name: Update versions repo
  77. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  78. run: ./update_version.sh
  79. env:
  80. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  81. GITHUB_USERNAME: ${{ github.repository_owner }}
  82. - name: Set MS_TAG as job output for release-winget job
  83. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  84. run: echo "::set-output name=tagname::${{ env.MS_TAG }}"
  85. release-winget:
  86. name: Release to WinGet
  87. needs: windows
  88. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  89. runs-on: windows-latest # action can only be run on windows
  90. steps:
  91. - name: Release to WinGet
  92. uses: vedantmgoyal2009/winget-releaser@latest
  93. with:
  94. identifier: VSCodium.VSCodium
  95. release-tag: ${{ needs.windows.outputs.tagname }}
  96. installers-regex: '\.exe$' # only .exe files
  97. token: ${{ secrets.STRONGER_GITHUB_TOKEN }}