stable-linux.yml 15 KB

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