insider-linux.yml 14 KB

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