insider-windows.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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: Switch to relevant branch
  54. env:
  55. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  56. run: ./get_pr.sh
  57. - name: Setup Node.js environment
  58. uses: actions/setup-node@v4
  59. with:
  60. node-version: '20.12'
  61. - name: Install Yarn
  62. run: npm install -g yarn
  63. - name: Setup Python 3
  64. uses: actions/setup-python@v5
  65. with:
  66. python-version: '3.11'
  67. - name: Clone VSCode repo
  68. run: ./get_repo.sh
  69. - name: Check PR or cron
  70. env:
  71. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  72. run: ./check_cron_or_pr.sh
  73. - name: Check existing VSCodium tags/releases
  74. env:
  75. DISABLE_MSI: ${{ vars.DISABLE_INSIDER_MSI }}
  76. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  77. run: ./check_tags.sh
  78. if: env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  79. - name: Build
  80. env:
  81. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  82. npm_config_arch: ${{ matrix.vscode_arch }}
  83. npm_config_target_arch: ${{ matrix.vscode_arch }}
  84. run: ./build.sh
  85. if: env.SHOULD_BUILD == 'yes'
  86. - name: Prepare assets
  87. run: ./prepare_assets.sh
  88. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  89. - name: Upload unsigned artifacts
  90. id: upload-unsigned-artifacts
  91. uses: actions/upload-artifact@v4
  92. with:
  93. name: unsigned-${{ matrix.vscode_arch }}
  94. path: |
  95. assets/*.exe
  96. assets/*.msi
  97. retention-days: 1
  98. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  99. - name: Signing
  100. uses: signpath/github-action-submit-signing-request@v1
  101. with:
  102. api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
  103. organization-id: '${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
  104. project-slug: '${{ secrets.SIGNPATH_PROJECT_SLUG }}'
  105. signing-policy-slug: '${{ secrets.SIGNPATH_POLICY_SLUG }}'
  106. github-artifact-id: '${{ steps.upload-unsigned-artifacts.outputs.artifact-id }}'
  107. artifact-configuration-slug: '${{ matrix.vscode_arch }}'
  108. wait-for-completion: true
  109. output-artifact-directory: assets/
  110. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  111. - name: Prepare checksums
  112. run: ./prepare_checksums.sh
  113. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  114. - name: Release
  115. env:
  116. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  117. GITHUB_USERNAME: ${{ github.repository_owner }}
  118. run: ./release.sh
  119. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  120. - name: Update versions repo
  121. env:
  122. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  123. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  124. GITHUB_USERNAME: ${{ github.repository_owner }}
  125. run: ./update_version.sh
  126. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  127. - name: Upload assets
  128. uses: actions/upload-artifact@v4
  129. with:
  130. name: bin-${{ matrix.vscode_arch }}
  131. path: assets/
  132. retention-days: 3
  133. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  134. winget:
  135. needs: build
  136. runs-on: windows-latest
  137. defaults:
  138. run:
  139. shell: bash
  140. env:
  141. APP_IDENTIFIER: VSCodium.VSCodium.Insiders
  142. ASSETS_REPOSITORY: vscodium-insiders
  143. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  144. steps:
  145. - uses: actions/checkout@v4
  146. with:
  147. ref: ${{ env.GITHUB_BRANCH }}
  148. - name: Check version
  149. run: ./stores/winget/check_version.sh
  150. env:
  151. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  152. - name: Release to WinGet
  153. uses: vedantmgoyal9/winget-releaser@main
  154. with:
  155. identifier: ${{ env.APP_IDENTIFIER }}
  156. version: ${{ env.RELEASE_VERSION }}
  157. release-repository: ${{ env.ASSETS_REPOSITORY }}
  158. release-tag: ${{ env.RELEASE_VERSION }}-insider
  159. installers-regex: '\.exe$' # only .exe files
  160. token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  161. if: env.SHOULD_DEPLOY == 'yes'