insider-linux.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. name: insider-linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. release_version:
  6. type: string
  7. description: Forced release version
  8. generate_assets:
  9. type: boolean
  10. description: Generate assets
  11. repository_dispatch:
  12. types: [insider]
  13. push:
  14. branches: [ insider ]
  15. paths-ignore:
  16. - '**/*.md'
  17. pull_request:
  18. branches: [ insider ]
  19. paths-ignore:
  20. - '**/*.md'
  21. env:
  22. APP_NAME: VSCodium
  23. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  24. BINARY_NAME: codium-insiders
  25. DISABLE_UPDATE: 'yes'
  26. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  27. OS_NAME: linux
  28. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  29. VSCODE_QUALITY: insider
  30. jobs:
  31. check:
  32. runs-on: ubuntu-latest
  33. outputs:
  34. MS_COMMIT: ${{ env.MS_COMMIT }}
  35. MS_TAG: ${{ env.MS_TAG }}
  36. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  37. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  38. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  39. steps:
  40. - uses: actions/checkout@v4
  41. with:
  42. ref: ${{ env.GITHUB_BRANCH }}
  43. - name: Clone VSCode repo
  44. env:
  45. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  46. run: ./get_repo.sh
  47. - name: Check PR or cron
  48. env:
  49. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  50. run: ./check_cron_or_pr.sh
  51. compile:
  52. needs:
  53. - check
  54. runs-on: ubuntu-20.04
  55. env:
  56. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  57. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  58. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  59. SHOULD_BUILD: 'yes'
  60. VSCODE_ARCH: 'x64'
  61. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  62. steps:
  63. - uses: actions/checkout@v4
  64. with:
  65. ref: ${{ env.GITHUB_BRANCH }}
  66. - name: Setup Node.js environment
  67. uses: actions/setup-node@v4
  68. with:
  69. node-version: '18.17'
  70. - name: Install Yarn
  71. run: npm install -g yarn
  72. - name: Setup Python 3
  73. uses: actions/setup-python@v5
  74. with:
  75. python-version: '3.11'
  76. - name: Install libkrb5-dev
  77. run: sudo apt-get install -y libkrb5-dev
  78. - name: Clone VSCode repo
  79. run: ./get_repo.sh
  80. - name: Check existing VSCodium tags/releases
  81. env:
  82. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  83. CHECK_ASSETS: 'no'
  84. run: ./check_tags.sh
  85. - name: Build
  86. run: ./build.sh
  87. - name: Compress vscode artifact
  88. run: |
  89. tar -cz --exclude='.build/node' --exclude='**/node_modules' -f vscode.tar.gz vscode
  90. - name: Upload vscode artifact
  91. uses: actions/upload-artifact@v3
  92. with:
  93. name: vscode
  94. path: ./vscode.tar.gz
  95. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  96. build:
  97. needs:
  98. - check
  99. - compile
  100. runs-on: ubuntu-latest
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. include:
  105. - vscode_arch: x64
  106. npm_arch: x64
  107. image: vscodium/vscodium-linux-build-agent:bionic-x64
  108. - vscode_arch: arm64
  109. npm_arch: arm64
  110. image: vscodium/vscodium-linux-build-agent:bionic-arm64
  111. - vscode_arch: armhf
  112. npm_arch: arm
  113. image: vscodium/vscodium-linux-build-agent:bionic-armhf
  114. container:
  115. image: ${{ matrix.image }}
  116. env:
  117. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  118. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  119. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  120. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  121. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  122. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  123. outputs:
  124. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  125. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  126. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  127. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  128. steps:
  129. - uses: actions/checkout@v3
  130. with:
  131. ref: ${{ env.GITHUB_BRANCH }}
  132. - name: Install GH
  133. run: ./install_gh.sh
  134. if: env.SHOULD_DEPLOY == 'yes'
  135. - name: Check existing VSCodium tags/releases
  136. env:
  137. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  138. CHECK_REH: 'no'
  139. run: ./check_tags.sh
  140. - name: Install libkrb5-dev
  141. run: sudo apt-get install -y libkrb5-dev
  142. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  143. - name: Download vscode artifact
  144. uses: actions/download-artifact@v3
  145. with:
  146. name: vscode
  147. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  148. - name: Build
  149. env:
  150. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  151. npm_config_arch: ${{ matrix.npm_arch }}
  152. run: ./package_linux_bin.sh
  153. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  154. - name: Prepare assets
  155. env:
  156. SHOULD_BUILD_REH: 'no'
  157. run: ./prepare_assets.sh
  158. if: env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  159. - name: Release
  160. env:
  161. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  162. GITHUB_USERNAME: ${{ github.repository_owner }}
  163. run: ./release.sh
  164. if: env.SHOULD_DEPLOY == 'yes'
  165. - name: Update versions repo
  166. env:
  167. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  168. GITHUB_USERNAME: ${{ github.repository_owner }}
  169. run: ./update_version.sh
  170. if: env.SHOULD_DEPLOY == 'yes'
  171. - name: Upload assets
  172. uses: actions/upload-artifact@v3
  173. with:
  174. name: bin-${{ matrix.vscode_arch }}
  175. path: assets/
  176. retention-days: 3
  177. if: env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  178. reh:
  179. needs:
  180. - check
  181. - compile
  182. runs-on: ubuntu-20.04
  183. strategy:
  184. fail-fast: false
  185. matrix:
  186. include:
  187. - vscode_arch: x64
  188. npm_arch: x64
  189. - vscode_arch: arm64
  190. npm_arch: arm64
  191. - vscode_arch: armhf
  192. npm_arch: arm
  193. # - vscode_arch: ppc64le
  194. # npm_arch: ppc64
  195. env:
  196. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  197. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  198. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  199. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  200. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  201. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  202. if: needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  203. steps:
  204. - uses: actions/checkout@v3
  205. with:
  206. ref: ${{ env.GITHUB_BRANCH }}
  207. - name: Install GH
  208. run: ./install_gh.sh
  209. - name: Check existing VSCodium tags/releases
  210. env:
  211. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  212. CHECK_ONLY_REH: 'yes'
  213. run: ./check_tags.sh
  214. - name: Download vscode artifact
  215. uses: actions/download-artifact@v3
  216. with:
  217. name: vscode
  218. if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
  219. - name: Build
  220. env:
  221. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  222. npm_config_arch: ${{ matrix.npm_arch }}
  223. run: ./package_linux_reh.sh
  224. if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
  225. - name: Release
  226. env:
  227. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  228. GITHUB_USERNAME: ${{ github.repository_owner }}
  229. run: ./release.sh
  230. if: env.SHOULD_DEPLOY == 'yes'
  231. - name: Upload assets
  232. uses: actions/upload-artifact@v3
  233. with:
  234. name: reh-${{ matrix.vscode_arch }}
  235. path: assets/
  236. retention-days: 3
  237. if: env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  238. aur:
  239. needs:
  240. - build
  241. runs-on: ubuntu-latest
  242. strategy:
  243. fail-fast: false
  244. matrix:
  245. include:
  246. - package_name: vscodium-insiders-bin
  247. - package_name: vscodium-insiders
  248. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  249. steps:
  250. - name: Get version
  251. env:
  252. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  253. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}"
  254. - name: Publish ${{ matrix.package_name }}
  255. uses: zokugun/github-actions-aur-releaser@v1
  256. with:
  257. package_name: ${{ matrix.package_name }}
  258. package_version: ${{ env.PACKAGE_VERSION }}
  259. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  260. aur_username: ${{ secrets.AUR_USERNAME }}
  261. aur_email: ${{ secrets.AUR_EMAIL }}
  262. snap:
  263. needs:
  264. - build
  265. runs-on: ubuntu-latest
  266. env:
  267. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  268. strategy:
  269. fail-fast: false
  270. matrix:
  271. platform:
  272. - amd64
  273. - arm64
  274. # if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  275. if: false
  276. steps:
  277. - uses: actions/checkout@v3
  278. with:
  279. ref: ${{ env.GITHUB_BRANCH }}
  280. - name: Check version
  281. env:
  282. ARCHITECTURE: ${{ matrix.platform }}
  283. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  284. run: ./stores/snapcraft/check_version.sh
  285. - uses: docker/setup-qemu-action@v3
  286. if: env.SHOULD_BUILD == 'yes'
  287. - name: Prepare snapcraft.yaml
  288. env:
  289. ARCHITECTURE: ${{ matrix.platform }}
  290. run: ./stores/snapcraft/build.sh
  291. if: env.SHOULD_BUILD == 'yes'
  292. # - uses: diddlesnaps/snapcraft-multiarch-action@v1
  293. # with:
  294. # path: stores/snapcraft/build
  295. # architecture: ${{ matrix.platform }}
  296. # id: build
  297. # if: env.SHOULD_BUILD == 'yes'
  298. - uses: snapcore/action-build@v1
  299. with:
  300. path: stores/snapcraft/build
  301. id: build
  302. if: env.SHOULD_BUILD == 'yes'
  303. # - uses: diddlesnaps/snapcraft-review-action@v1
  304. # with:
  305. # snap: ${{ steps.build.outputs.snap }}
  306. # isClassic: 'true'
  307. # if: env.SHOULD_BUILD == 'yes'
  308. - uses: svenstaro/upload-release-action@v2
  309. with:
  310. repo_name: ${{ env.ASSETS_REPOSITORY }}
  311. repo_token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  312. file: ${{ steps.build.outputs.snap }}
  313. tag: ${{ env.RELEASE_VERSION }}
  314. if: env.SHOULD_DEPLOY_TO_RELEASE == 'yes'