insider-linux.yml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. name: insider-linux
  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. - 'upstream/*.json'
  21. pull_request:
  22. branches: [ insider ]
  23. paths-ignore:
  24. - '**/*.md'
  25. env:
  26. ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
  27. APP_NAME: VSCodium
  28. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  29. BINARY_NAME: codium-insiders
  30. DISABLE_UPDATE: 'yes'
  31. GH_REPO_PATH: ${{ github.repository_owner }}/${{ github.repository }}
  32. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  33. ORG_NAME: ${{ github.repository_owner }}
  34. OS_NAME: linux
  35. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  36. VSCODE_QUALITY: insider
  37. jobs:
  38. check:
  39. runs-on: ubuntu-latest
  40. outputs:
  41. MS_COMMIT: ${{ env.MS_COMMIT }}
  42. MS_TAG: ${{ env.MS_TAG }}
  43. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  44. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  45. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  46. steps:
  47. - uses: actions/checkout@v4
  48. with:
  49. ref: ${{ env.GITHUB_BRANCH }}
  50. - name: Switch to relevant branch
  51. env:
  52. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  53. run: ./get_pr.sh
  54. - name: Clone VSCode repo
  55. run: ./get_repo.sh
  56. - name: Check PR or cron
  57. env:
  58. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  59. run: ./check_cron_or_pr.sh
  60. - name: Check existing VSCodium tags/releases
  61. env:
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. CHECK_ALL: 'yes'
  64. run: ./check_tags.sh
  65. compile:
  66. needs:
  67. - check
  68. runs-on: ubuntu-20.04
  69. env:
  70. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  71. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  72. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  73. SHOULD_BUILD: ${{ (needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true') && 'yes' || 'no' }}
  74. VSCODE_ARCH: 'x64'
  75. outputs:
  76. BUILD_SOURCEVERSION: ${{ env.BUILD_SOURCEVERSION }}
  77. steps:
  78. - uses: actions/checkout@v4
  79. with:
  80. ref: ${{ env.GITHUB_BRANCH }}
  81. if: env.SHOULD_BUILD == 'yes'
  82. - name: Switch to relevant branch
  83. env:
  84. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  85. run: ./get_pr.sh
  86. - name: Setup GCC
  87. uses: egor-tensin/setup-gcc@v1
  88. with:
  89. version: 10
  90. platform: x64
  91. - name: Setup Node.js environment
  92. uses: actions/setup-node@v4
  93. with:
  94. node-version: '20.18.2'
  95. if: env.SHOULD_BUILD == 'yes'
  96. - name: Install Yarn
  97. run: npm install -g yarn
  98. if: env.SHOULD_BUILD == 'yes'
  99. - name: Setup Python 3
  100. uses: actions/setup-python@v5
  101. with:
  102. python-version: '3.11'
  103. if: env.SHOULD_BUILD == 'yes'
  104. - name: Install libkrb5-dev
  105. run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
  106. if: env.SHOULD_BUILD == 'yes'
  107. - name: Clone VSCode repo
  108. run: ./get_repo.sh
  109. if: env.SHOULD_BUILD == 'yes'
  110. - name: Build
  111. env:
  112. SHOULD_BUILD_REH: 'no'
  113. SHOULD_BUILD_REH_WEB: 'no'
  114. run: ./build.sh
  115. if: env.SHOULD_BUILD == 'yes'
  116. - name: Compress vscode artifact
  117. run: |
  118. find vscode -type f -not -path "*/node_modules/*" -not -path "vscode/.build/node/*" -not -path "vscode/.git/*" > vscode.txt
  119. echo "vscode/.build/extensions/node_modules" >> vscode.txt
  120. echo "vscode/.git" >> vscode.txt
  121. tar -czf vscode.tar.gz -T vscode.txt
  122. if: env.SHOULD_BUILD == 'yes'
  123. - name: Upload vscode artifact
  124. uses: actions/upload-artifact@v4
  125. with:
  126. name: vscode
  127. path: ./vscode.tar.gz
  128. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  129. if: env.SHOULD_BUILD == 'yes'
  130. build:
  131. needs:
  132. - check
  133. - compile
  134. runs-on: ubuntu-latest
  135. strategy:
  136. fail-fast: false
  137. matrix:
  138. include:
  139. - slug: X64
  140. vscode_arch: x64
  141. npm_arch: x64
  142. image: vscodium/vscodium-linux-build-agent:focal-x64
  143. - slug: ARM64
  144. vscode_arch: arm64
  145. npm_arch: arm64
  146. image: vscodium/vscodium-linux-build-agent:focal-arm64
  147. - slug: ARM32
  148. vscode_arch: armhf
  149. npm_arch: arm
  150. image: vscodium/vscodium-linux-build-agent:focal-armhf
  151. - slug: RISCV64
  152. vscode_arch: riscv64
  153. npm_arch: riscv64
  154. image: vscodium/vscodium-linux-build-agent:focal-riscv64
  155. - slug: LOONG64
  156. vscode_arch: loong64
  157. npm_arch: loong64
  158. image: vscodium/vscodium-linux-build-agent:beige-loong64
  159. - slug: PPC64
  160. vscode_arch: ppc64le
  161. npm_arch: ppc64
  162. image: vscodium/vscodium-linux-build-agent:focal-ppc64le
  163. container:
  164. image: ${{ matrix.image }}
  165. env:
  166. BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }}
  167. DISABLED: ${{ vars[format('DISABLE_INSIDER_LINUX_APP_{0}', matrix.slug)] }}
  168. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  169. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  170. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  171. SHOULD_BUILD: ${{ (needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true') && 'yes' || 'no' }}
  172. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  173. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  174. outputs:
  175. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  176. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  177. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  178. steps:
  179. - uses: actions/checkout@v4
  180. with:
  181. ref: ${{ env.GITHUB_BRANCH }}
  182. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  183. - name: Switch to relevant branch
  184. env:
  185. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  186. run: ./get_pr.sh
  187. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  188. - name: Install GH
  189. run: ./install_gh.sh
  190. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  191. - name: Check existing VSCodium tags/releases
  192. env:
  193. CHECK_REH: 'no'
  194. DISABLE_APPIMAGE: ${{ vars.DISABLE_INSIDER_APPIMAGE }}
  195. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  196. run: ./check_tags.sh
  197. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  198. - name: Install libkrb5-dev
  199. run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
  200. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  201. - name: Download vscode artifact
  202. uses: actions/download-artifact@v4
  203. with:
  204. name: vscode
  205. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  206. - name: Build
  207. env:
  208. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  209. npm_config_arch: ${{ matrix.npm_arch }}
  210. run: ./build/linux/package_bin.sh
  211. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
  212. - name: Prepare assets
  213. env:
  214. SHOULD_BUILD_REH: 'no'
  215. SHOULD_BUILD_REH_WEB: 'no'
  216. run: ./prepare_assets.sh
  217. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  218. - name: Release
  219. env:
  220. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  221. GITHUB_USERNAME: ${{ github.repository_owner }}
  222. run: ./release.sh
  223. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  224. - name: Update versions repo
  225. env:
  226. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  227. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  228. GITHUB_USERNAME: ${{ github.repository_owner }}
  229. run: ./update_version.sh
  230. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  231. - name: Upload assets
  232. uses: actions/upload-artifact@v4
  233. with:
  234. name: bin-${{ matrix.vscode_arch }}
  235. path: assets/
  236. retention-days: 3
  237. if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  238. reh_linux:
  239. needs:
  240. - check
  241. - compile
  242. runs-on: ubuntu-20.04
  243. strategy:
  244. fail-fast: false
  245. matrix:
  246. include:
  247. - slug: X64
  248. vscode_arch: x64
  249. npm_arch: x64
  250. - slug: ARM64
  251. vscode_arch: arm64
  252. npm_arch: arm64
  253. - slug: ARM32
  254. vscode_arch: armhf
  255. npm_arch: arm
  256. - slug: PPC64
  257. vscode_arch: ppc64le
  258. npm_arch: ppc64
  259. - slug: RISCV64
  260. vscode_arch: riscv64
  261. npm_arch: riscv64
  262. - slug: LOONG64
  263. vscode_arch: loong64
  264. npm_arch: loong64
  265. - slug: S390X
  266. vscode_arch: s390x
  267. npm_arch: s390x
  268. env:
  269. BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }}
  270. DISABLED: ${{ vars[format('DISABLE_INSIDER_LINUX_REH_{0}', matrix.slug)] }}
  271. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  272. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  273. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  274. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  275. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  276. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  277. if: needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  278. steps:
  279. - uses: actions/checkout@v4
  280. with:
  281. ref: ${{ env.GITHUB_BRANCH }}
  282. if: env.DISABLED != 'yes'
  283. - name: Switch to relevant branch
  284. env:
  285. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  286. run: ./get_pr.sh
  287. if: env.DISABLED != 'yes'
  288. - name: Setup GCC
  289. uses: egor-tensin/setup-gcc@v1
  290. with:
  291. version: 10
  292. platform: x64
  293. if: env.DISABLED != 'yes'
  294. - name: Setup Node.js environment
  295. uses: actions/setup-node@v4
  296. with:
  297. node-version: '20.18.2'
  298. if: env.DISABLED != 'yes'
  299. - name: Setup Python 3
  300. uses: actions/setup-python@v5
  301. with:
  302. python-version: '3.11'
  303. if: env.DISABLED != 'yes'
  304. - name: Install libkrb5-dev
  305. run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
  306. if: env.DISABLED != 'yes'
  307. - name: Install GH
  308. run: ./install_gh.sh
  309. if: env.DISABLED != 'yes' && env.SHOULD_DEPLOY == 'yes'
  310. - name: Check existing VSCodium tags/releases
  311. env:
  312. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  313. CHECK_ONLY_REH: 'yes'
  314. run: ./check_tags.sh
  315. if: env.DISABLED != 'yes'
  316. - name: Download vscode artifact
  317. uses: actions/download-artifact@v4
  318. with:
  319. name: vscode
  320. if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
  321. - name: Build
  322. env:
  323. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  324. npm_config_arch: ${{ matrix.npm_arch }}
  325. run: ./build/linux/package_reh.sh
  326. if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
  327. - name: Release
  328. env:
  329. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  330. GITHUB_USERNAME: ${{ github.repository_owner }}
  331. run: ./release.sh
  332. if: env.DISABLED != 'yes' && env.SHOULD_DEPLOY == 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no')
  333. - name: Upload assets
  334. uses: actions/upload-artifact@v4
  335. with:
  336. name: reh-linux-${{ matrix.vscode_arch }}
  337. path: assets/
  338. retention-days: 3
  339. if: env.DISABLED != 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  340. reh_alpine:
  341. needs:
  342. - check
  343. - compile
  344. runs-on: ubuntu-20.04
  345. strategy:
  346. fail-fast: false
  347. matrix:
  348. include:
  349. - slug: X64
  350. vscode_arch: x64
  351. npm_arch: x64
  352. - slug: ARM64
  353. vscode_arch: arm64
  354. npm_arch: arm64
  355. env:
  356. BUILD_SOURCEVERSION: ${{ needs.compile.outputs.BUILD_SOURCEVERSION }}
  357. DISABLED: ${{ vars[format('DISABLE_INSIDER_ALPINE_REH_{0}', matrix.slug)] }}
  358. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  359. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  360. OS_NAME: alpine
  361. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  362. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  363. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  364. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  365. if: needs.check.outputs.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  366. steps:
  367. - uses: actions/checkout@v4
  368. with:
  369. ref: ${{ env.GITHUB_BRANCH }}
  370. - name: Switch to relevant branch
  371. env:
  372. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  373. run: ./get_pr.sh
  374. - name: Setup GCC
  375. uses: egor-tensin/setup-gcc@v1
  376. with:
  377. version: 10
  378. platform: x64
  379. - name: Install GH
  380. run: ./install_gh.sh
  381. if: env.SHOULD_DEPLOY == 'yes'
  382. - name: Check existing VSCodium tags/releases
  383. env:
  384. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  385. CHECK_ONLY_REH: 'yes'
  386. run: ./check_tags.sh
  387. - name: Install libkrb5-dev
  388. run: sudo apt-get update -y && sudo apt-get install -y libkrb5-dev
  389. if: env.SHOULD_BUILD == 'yes'
  390. - name: Download vscode artifact
  391. uses: actions/download-artifact@v4
  392. with:
  393. name: vscode
  394. if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
  395. - name: Build
  396. env:
  397. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  398. npm_config_arch: ${{ matrix.npm_arch }}
  399. run: ./build/alpine/package_reh.sh
  400. if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
  401. - name: Release
  402. env:
  403. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  404. GITHUB_USERNAME: ${{ github.repository_owner }}
  405. run: ./release.sh
  406. if: env.DISABLED != 'yes' && env.SHOULD_DEPLOY == 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no')
  407. - name: Upload assets
  408. uses: actions/upload-artifact@v4
  409. with:
  410. name: reh-alpine-${{ matrix.vscode_arch }}
  411. path: assets/
  412. retention-days: 3
  413. if: env.DISABLED != 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  414. aur:
  415. needs:
  416. - check
  417. - build
  418. runs-on: ubuntu-latest
  419. strategy:
  420. fail-fast: false
  421. matrix:
  422. include:
  423. - package_name: vscodium-insiders-bin
  424. - package_name: vscodium-insiders
  425. if: needs.check.outputs.SHOULD_DEPLOY == 'yes' && github.event.inputs.generate_assets != 'true'
  426. steps:
  427. - name: Get version
  428. env:
  429. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  430. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}"
  431. - name: Publish ${{ matrix.package_name }}
  432. uses: zokugun/github-actions-aur-releaser@v1
  433. with:
  434. package_name: ${{ matrix.package_name }}
  435. package_version: ${{ env.PACKAGE_VERSION }}
  436. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  437. aur_username: ${{ secrets.AUR_USERNAME }}
  438. aur_email: ${{ secrets.AUR_EMAIL }}
  439. snap:
  440. needs:
  441. - check
  442. - build
  443. runs-on: ubuntu-latest
  444. env:
  445. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  446. SNAP_NAME: codium-insiders
  447. strategy:
  448. fail-fast: false
  449. matrix:
  450. platform:
  451. - amd64
  452. - arm64
  453. if: needs.check.outputs.SHOULD_DEPLOY == 'yes' && needs.check.outputs.SHOULD_BUILD_SNAP != 'no' && vars.DISABLE_INSIDER_SNAP != 'yes'
  454. steps:
  455. - uses: actions/checkout@v4
  456. with:
  457. ref: ${{ env.GITHUB_BRANCH }}
  458. - name: Switch to relevant branch
  459. env:
  460. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  461. run: ./get_pr.sh
  462. - uses: docker/setup-qemu-action@v3
  463. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  464. with:
  465. path: stores/snapcraft/insider
  466. architecture: ${{ matrix.platform }}
  467. id: build
  468. - uses: diddlesnaps/snapcraft-review-action@v1
  469. with:
  470. snap: ${{ steps.build.outputs.snap }}
  471. isClassic: 'true'
  472. - uses: svenstaro/upload-release-action@v2
  473. with:
  474. repo_name: ${{ env.ASSETS_REPOSITORY }}
  475. repo_token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  476. file: ${{ steps.build.outputs.snap }}
  477. tag: ${{ env.RELEASE_VERSION }}