insider-linux.yml 17 KB

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