insider-linux.yml 17 KB

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