stable-linux.yml 16 KB

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