stable-linux.yml 14 KB

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