insider-windows.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. name: insider-windows
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. force_version:
  6. type: boolean
  7. description: Force update version
  8. generate_assets:
  9. type: boolean
  10. description: Generate assets
  11. checkout_pr:
  12. type: string
  13. description: Checkout PR
  14. repository_dispatch:
  15. types: [insider]
  16. push:
  17. branches: [ insider ]
  18. paths-ignore:
  19. - '**/*.md'
  20. pull_request:
  21. branches: [ insider ]
  22. paths-ignore:
  23. - '**/*.md'
  24. env:
  25. APP_NAME: VSCodium
  26. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  27. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  28. OS_NAME: windows
  29. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  30. VSCODE_QUALITY: insider
  31. jobs:
  32. build:
  33. runs-on: windows-2019
  34. defaults:
  35. run:
  36. shell: bash
  37. env:
  38. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  39. strategy:
  40. fail-fast: false
  41. matrix:
  42. vscode_arch:
  43. - x64
  44. # - ia32
  45. - arm64
  46. outputs:
  47. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  48. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  49. steps:
  50. - uses: actions/checkout@v4
  51. with:
  52. ref: ${{ env.GITHUB_BRANCH }}
  53. - name: Setup Node.js environment
  54. uses: actions/setup-node@v4
  55. with:
  56. node-version: '18.17'
  57. - name: Install Yarn
  58. run: npm install -g yarn
  59. - name: Setup Python 3
  60. uses: actions/setup-python@v5
  61. with:
  62. python-version: '3.11'
  63. - name: Clone VSCode repo
  64. env:
  65. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  66. run: ./get_repo.sh
  67. - name: Check PR or cron
  68. env:
  69. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  70. run: ./check_cron_or_pr.sh
  71. - name: Check existing VSCodium tags/releases
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. run: ./check_tags.sh
  75. if: env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  76. - name: Build
  77. env:
  78. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  79. npm_config_arch: ${{ matrix.vscode_arch }}
  80. npm_config_target_arch: ${{ matrix.vscode_arch }}
  81. run: ./build.sh
  82. if: env.SHOULD_BUILD == 'yes'
  83. - name: Prepare assets
  84. run: ./prepare_assets.sh
  85. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  86. - name: Release
  87. env:
  88. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  89. GITHUB_USERNAME: ${{ github.repository_owner }}
  90. run: ./release.sh
  91. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  92. - name: Update versions repo
  93. env:
  94. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  95. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  96. GITHUB_USERNAME: ${{ github.repository_owner }}
  97. run: ./update_version.sh
  98. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  99. - name: Upload assets
  100. uses: actions/upload-artifact@v4
  101. with:
  102. name: bin-${{ matrix.vscode_arch }}
  103. path: assets/
  104. retention-days: 3
  105. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  106. winget:
  107. needs: build
  108. runs-on: windows-latest
  109. defaults:
  110. run:
  111. shell: bash
  112. env:
  113. APP_IDENTIFIER: VSCodium.VSCodium.Insiders
  114. ASSETS_REPOSITORY: vscodium-insiders
  115. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  116. steps:
  117. - uses: actions/checkout@v4
  118. with:
  119. ref: ${{ env.GITHUB_BRANCH }}
  120. - name: Check version
  121. run: ./stores/winget/check_version.sh
  122. env:
  123. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  124. - name: Release to WinGet
  125. uses: vedantmgoyal2009/winget-releaser@v2
  126. with:
  127. identifier: ${{ env.APP_IDENTIFIER }}
  128. version: ${{ env.RELEASE_VERSION }}
  129. release-repository: ${{ env.ASSETS_REPOSITORY }}
  130. release-tag: ${{ env.RELEASE_VERSION }}-insider
  131. installers-regex: '\.exe$' # only .exe files
  132. token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  133. if: env.SHOULD_DEPLOY == 'yes'