insider-windows.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  76. run: ./check_tags.sh
  77. if: env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  78. - name: Build
  79. env:
  80. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  81. npm_config_arch: ${{ matrix.vscode_arch }}
  82. npm_config_target_arch: ${{ matrix.vscode_arch }}
  83. run: ./build.sh
  84. if: env.SHOULD_BUILD == 'yes'
  85. - name: Prepare assets
  86. run: ./prepare_assets.sh
  87. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  88. - name: Release
  89. env:
  90. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  91. GITHUB_USERNAME: ${{ github.repository_owner }}
  92. run: ./release.sh
  93. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  94. - name: Update versions repo
  95. env:
  96. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  97. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  98. GITHUB_USERNAME: ${{ github.repository_owner }}
  99. run: ./update_version.sh
  100. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  101. - name: Upload assets
  102. uses: actions/upload-artifact@v4
  103. with:
  104. name: bin-${{ matrix.vscode_arch }}
  105. path: assets/
  106. retention-days: 3
  107. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  108. winget:
  109. needs: build
  110. runs-on: windows-latest
  111. defaults:
  112. run:
  113. shell: bash
  114. env:
  115. APP_IDENTIFIER: VSCodium.VSCodium.Insiders
  116. ASSETS_REPOSITORY: vscodium-insiders
  117. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  118. steps:
  119. - uses: actions/checkout@v4
  120. with:
  121. ref: ${{ env.GITHUB_BRANCH }}
  122. - name: Check version
  123. run: ./stores/winget/check_version.sh
  124. env:
  125. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  126. - name: Release to WinGet
  127. uses: vedantmgoyal9/winget-releaser@main
  128. with:
  129. identifier: ${{ env.APP_IDENTIFIER }}
  130. version: ${{ env.RELEASE_VERSION }}
  131. release-repository: ${{ env.ASSETS_REPOSITORY }}
  132. release-tag: ${{ env.RELEASE_VERSION }}-insider
  133. installers-regex: '\.exe$' # only .exe files
  134. token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  135. if: env.SHOULD_DEPLOY == 'yes'