insider-linux.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. name: insider-linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. release_version:
  6. type: string
  7. description: Forced release version
  8. schedule:
  9. - cron: '0 8 * * *'
  10. push:
  11. branches: [ insider ]
  12. paths-ignore:
  13. - '**/*.md'
  14. pull_request:
  15. branches: [ insider ]
  16. paths-ignore:
  17. - '**/*.md'
  18. jobs:
  19. check:
  20. runs-on: ubuntu-latest
  21. container:
  22. image: vscodium/vscodium-linux-build-agent:bionic-x64
  23. env:
  24. GITHUB_BRANCH: insider
  25. VSCODE_QUALITY: insider
  26. outputs:
  27. GITHUB_BRANCH: ${{ env.GITHUB_BRANCH }}
  28. MS_COMMIT: ${{ env.MS_COMMIT }}
  29. MS_TAG: ${{ env.MS_TAG }}
  30. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  31. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  32. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  33. VSCODE_QUALITY: ${{ env.VSCODE_QUALITY }}
  34. steps:
  35. - uses: actions/checkout@v3
  36. with:
  37. ref: ${{ env.GITHUB_BRANCH }}
  38. - name: Clone VSCode repo
  39. env:
  40. RELEASE_VERSION: ${{ github.event.inputs.release_version }}
  41. run: ./get_repo.sh
  42. - name: Check PR or cron
  43. run: ./check_cron_or_pr.sh
  44. dependencies:
  45. needs:
  46. - check
  47. runs-on: ubuntu-latest
  48. container:
  49. image: ${{ matrix.image }}
  50. env:
  51. GITHUB_BRANCH: ${{ needs.check.outputs.GITHUB_BRANCH }}
  52. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  53. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  54. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  55. VSCODE_QUALITY: ${{ needs.check.outputs.VSCODE_QUALITY }}
  56. strategy:
  57. fail-fast: false
  58. matrix:
  59. include:
  60. - vscode_arch: x64
  61. image: vscodium/vscodium-linux-build-agent:centos7-devtoolset8-x64
  62. # - vscode_arch: arm64
  63. # image: vscodium/vscodium-linux-build-agent:bionic-x64
  64. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  65. steps:
  66. - uses: actions/checkout@v3
  67. with:
  68. ref: ${{ env.GITHUB_BRANCH }}
  69. - name: Clone VSCode repo
  70. run: ./get_repo.sh
  71. - uses: docker/setup-qemu-action@v2
  72. if: matrix.vscode_arch == 'arm64'
  73. - name: Setup Node.js environment
  74. uses: actions/setup-node@v3
  75. with:
  76. node-version: 16
  77. - name: Install Yarn
  78. run: npm install -g yarn
  79. - name: Install remote dependencies (x64)
  80. env:
  81. npm_config_arch: x64
  82. run: ./install_remote_dependencies.sh
  83. if: matrix.vscode_arch == 'x64'
  84. # - name: Install remote dependencies (arm64)
  85. # run: |
  86. # set -e
  87. # docker run -e VSCODE_QUALITY -e GITHUB_TOKEN -v $(pwd):/root/vscodium vscodium/vscodium-linux-build-agent:centos7-devtoolset8-arm64 /root/vscodium/install_remote_dependencies.sh
  88. # if: matrix.vscode_arch == 'arm64'
  89. - name: Save remote dependencies
  90. uses: actions/upload-artifact@v3
  91. with:
  92. name: remote-dependencies-${{ matrix.vscode_arch }}
  93. path: ./vscode/remote/node_modules
  94. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  95. build:
  96. needs:
  97. - check
  98. - dependencies
  99. runs-on: ubuntu-latest
  100. container:
  101. image: ${{ matrix.image }}
  102. env:
  103. APP_NAME: VSCodium
  104. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  105. GITHUB_BRANCH: ${{ needs.check.outputs.GITHUB_BRANCH }}
  106. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  107. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  108. OS_NAME: linux
  109. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  110. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  111. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  112. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  113. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  114. VSCODE_QUALITY: ${{ needs.check.outputs.VSCODE_QUALITY }}
  115. strategy:
  116. fail-fast: false
  117. matrix:
  118. include:
  119. - vscode_arch: x64
  120. npm_arch: x64
  121. image: vscodium/vscodium-linux-build-agent:bionic-x64
  122. - vscode_arch: arm64
  123. npm_arch: arm64
  124. image: vscodium/vscodium-linux-build-agent:stretch-arm64
  125. - vscode_arch: armhf
  126. npm_arch: armv7l
  127. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  128. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  129. steps:
  130. - name: Re-export env variables
  131. run: |
  132. echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
  133. echo "SHOULD_DEPLOY=${SHOULD_DEPLOY}" >> "${GITHUB_ENV}"
  134. - uses: actions/checkout@v3
  135. with:
  136. ref: ${{ env.GITHUB_BRANCH }}
  137. - name: Clone VSCode repo
  138. run: ./get_repo.sh
  139. - name: Install GH
  140. run: ./install_gh.sh
  141. - name: Setup Node.js environment
  142. uses: actions/setup-node@v3
  143. with:
  144. node-version: 16
  145. - name: Install Yarn
  146. run: npm install -g yarn
  147. - name: Check existing VSCodium tags/releases
  148. env:
  149. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  150. run: ./check_tags.sh
  151. if: env.SHOULD_DEPLOY == 'yes'
  152. - name: Compute cache key
  153. id: yarnCacheKey
  154. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  155. if: env.SHOULD_BUILD == 'yes'
  156. - name: Get yarn cache directory path
  157. id: yarnCacheDirPath
  158. run: echo "::set-output name=dir::$(yarn cache dir)"
  159. if: env.SHOULD_BUILD == 'yes'
  160. - name: Cache yarn directory
  161. uses: actions/cache@v3
  162. with:
  163. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  164. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  165. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  166. if: env.SHOULD_BUILD == 'yes'
  167. - name: Restore remote dependencies
  168. uses: actions/download-artifact@v3
  169. with:
  170. name: remote-dependencies-${{ matrix.vscode_arch }}
  171. path: ./vscode/remote/node_modules
  172. if: env.SHOULD_BUILD == 'yes' && matrix.vscode_arch == 'x64'
  173. - name: Build
  174. env:
  175. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  176. npm_config_arch: ${{ matrix.npm_arch }}
  177. run: ./build.sh
  178. if: env.SHOULD_BUILD == 'yes'
  179. - name: Prepare assets
  180. run: ./prepare_assets.sh
  181. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  182. - name: Release
  183. env:
  184. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  185. GITHUB_USERNAME: ${{ github.repository_owner }}
  186. run: ./release.sh
  187. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  188. - name: Update versions repo
  189. env:
  190. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  191. GITHUB_USERNAME: ${{ github.repository_owner }}
  192. run: ./update_version.sh
  193. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  194. aur:
  195. needs:
  196. - check
  197. - build
  198. runs-on: ubuntu-latest
  199. strategy:
  200. fail-fast: false
  201. matrix:
  202. include:
  203. - package_name: vscodium-insiders-bin
  204. - package_name: vscodium-insiders
  205. if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
  206. steps:
  207. - name: Get version
  208. env:
  209. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  210. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}"
  211. - name: Publish ${{ matrix.package_name }}
  212. uses: zokugun/github-actions-aur-releaser@v1
  213. with:
  214. package_name: ${{ matrix.package_name }}
  215. package_version: ${{ env.PACKAGE_VERSION }}
  216. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  217. aur_username: ${{ secrets.AUR_USERNAME }}
  218. aur_email: ${{ secrets.AUR_EMAIL }}
  219. snap:
  220. needs:
  221. - check
  222. - build
  223. runs-on: ubuntu-latest
  224. env:
  225. APP_NAME: codium
  226. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  227. VSCODE_QUALITY: 'insider'
  228. strategy:
  229. fail-fast: false
  230. matrix:
  231. platform:
  232. - amd64
  233. - arm64
  234. # if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
  235. if: ${{ false }}
  236. steps:
  237. - uses: actions/checkout@v3
  238. with:
  239. ref: insider
  240. - name: Check version
  241. env:
  242. ARCHITECTURE: ${{ matrix.platform }}
  243. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  244. run: ./stores/snapcraft/check_version.sh
  245. - uses: docker/setup-qemu-action@v1
  246. if: env.SHOULD_DEPLOY == 'yes'
  247. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  248. with:
  249. path: stores/snapcraft/insider
  250. architecture: ${{ matrix.platform }}
  251. id: build
  252. if: env.SHOULD_DEPLOY == 'yes'
  253. - uses: diddlesnaps/snapcraft-review-action@v1
  254. with:
  255. snap: ${{ steps.build.outputs.snap }}
  256. isClassic: 'true'
  257. if: env.SHOULD_DEPLOY == 'yes'
  258. - uses: snapcore/action-publish@master
  259. env:
  260. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  261. with:
  262. snap: ${{ steps.build.outputs.snap }}
  263. release: edge
  264. if: env.SHOULD_DEPLOY == 'yes'