insider-linux.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. name: insider-linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. release_version:
  6. type: string
  7. description: Forced release version
  8. generate_assets:
  9. type: boolean
  10. description: Generate assets
  11. repository_dispatch:
  12. types: [insider]
  13. push:
  14. branches: [ insider ]
  15. paths-ignore:
  16. - '**/*.md'
  17. pull_request:
  18. branches: [ insider ]
  19. paths-ignore:
  20. - '**/*.md'
  21. env:
  22. APP_NAME: VSCodium
  23. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  24. BINARY_NAME: codium-insiders
  25. DISABLE_UPDATE: 'yes'
  26. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  27. OS_NAME: linux
  28. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  29. VSCODE_QUALITY: insider
  30. jobs:
  31. check:
  32. runs-on: ubuntu-latest
  33. outputs:
  34. MS_COMMIT: ${{ env.MS_COMMIT }}
  35. MS_TAG: ${{ env.MS_TAG }}
  36. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  37. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  38. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  39. steps:
  40. - uses: actions/checkout@v4
  41. with:
  42. ref: ${{ env.GITHUB_BRANCH }}
  43. - name: Clone VSCode repo
  44. env:
  45. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  46. run: ./get_repo.sh
  47. - name: Check PR or cron
  48. env:
  49. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  50. run: ./check_cron_or_pr.sh
  51. - name: Check existing VSCodium tags/releases
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. CHECK_ASSETS: 'no'
  55. run: ./check_tags.sh
  56. compile:
  57. needs:
  58. - check
  59. runs-on: ubuntu-20.04
  60. env:
  61. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  62. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  63. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  64. SHOULD_BUILD: 'yes'
  65. VSCODE_ARCH: 'x64'
  66. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  67. steps:
  68. - uses: actions/checkout@v4
  69. with:
  70. ref: ${{ env.GITHUB_BRANCH }}
  71. - name: Setup Node.js environment
  72. uses: actions/setup-node@v4
  73. with:
  74. node-version: '18.17'
  75. - name: Install Yarn
  76. run: npm install -g yarn
  77. - name: Setup Python 3
  78. uses: actions/setup-python@v5
  79. with:
  80. python-version: '3.11'
  81. - name: Install libkrb5-dev
  82. run: sudo apt-get install -y libkrb5-dev
  83. - name: Clone VSCode repo
  84. run: ./get_repo.sh
  85. - name: Build
  86. run: ./build.sh
  87. - name: Compress vscode artifact
  88. run: |
  89. tar -cz --exclude='.build/node' --exclude='**/node_modules' -f vscode.tar.gz vscode
  90. - name: Upload vscode artifact
  91. uses: actions/upload-artifact@v3
  92. with:
  93. name: vscode
  94. path: ./vscode.tar.gz
  95. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  96. build:
  97. needs:
  98. - check
  99. - compile
  100. runs-on: ubuntu-latest
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. include:
  105. - vscode_arch: x64
  106. npm_arch: x64
  107. image: vscodium/vscodium-linux-build-agent:bionic-x64
  108. - vscode_arch: arm64
  109. npm_arch: arm64
  110. image: vscodium/vscodium-linux-build-agent:bionic-arm64
  111. - vscode_arch: armhf
  112. npm_arch: arm
  113. image: vscodium/vscodium-linux-build-agent:bionic-armhf
  114. container:
  115. image: ${{ matrix.image }}
  116. env:
  117. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  118. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  119. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  120. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  121. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  122. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  123. outputs:
  124. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  125. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  126. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  127. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  128. steps:
  129. - uses: actions/checkout@v3
  130. with:
  131. ref: ${{ env.GITHUB_BRANCH }}
  132. - name: Install GH
  133. run: ./install_gh.sh
  134. if: env.SHOULD_DEPLOY == 'yes'
  135. - name: Check existing VSCodium tags/releases
  136. env:
  137. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  138. CHECK_REH: 'no'
  139. run: ./check_tags.sh
  140. - name: Install libkrb5-dev
  141. run: sudo apt-get install -y libkrb5-dev
  142. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  143. - name: Download vscode artifact
  144. uses: actions/download-artifact@v3
  145. with:
  146. name: vscode
  147. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  148. - name: Build
  149. env:
  150. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  151. npm_config_arch: ${{ matrix.npm_arch }}
  152. run: ./package_linux_bin.sh
  153. if: env.SHOULD_BUILD == 'yes' || github.event.inputs.generate_assets == 'true'
  154. - name: Prepare assets
  155. env:
  156. SHOULD_BUILD_REH: 'no'
  157. run: ./prepare_assets.sh
  158. if: (env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes') || github.event.inputs.generate_assets == 'true'
  159. - name: Release
  160. env:
  161. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  162. GITHUB_USERNAME: ${{ github.repository_owner }}
  163. run: ./release.sh
  164. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  165. - name: Update versions repo
  166. env:
  167. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  168. GITHUB_USERNAME: ${{ github.repository_owner }}
  169. run: ./update_version.sh
  170. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  171. - name: Upload assets
  172. uses: actions/upload-artifact@v3
  173. with:
  174. name: bin-${{ matrix.vscode_arch }}
  175. path: assets/
  176. retention-days: 3
  177. if: env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  178. reh:
  179. needs:
  180. - check
  181. - compile
  182. runs-on: ubuntu-20.04
  183. strategy:
  184. fail-fast: false
  185. matrix:
  186. include:
  187. - vscode_arch: x64
  188. npm_arch: x64
  189. - vscode_arch: arm64
  190. npm_arch: arm64
  191. - vscode_arch: armhf
  192. npm_arch: arm
  193. # - vscode_arch: ppc64le
  194. # npm_arch: ppc64
  195. env:
  196. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  197. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  198. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  199. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  200. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  201. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  202. if: needs.check.outputs.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true'
  203. steps:
  204. - uses: actions/checkout@v3
  205. with:
  206. ref: ${{ env.GITHUB_BRANCH }}
  207. - name: Install GH
  208. run: ./install_gh.sh
  209. - name: Check existing VSCodium tags/releases
  210. env:
  211. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  212. CHECK_ONLY_REH: 'yes'
  213. run: ./check_tags.sh
  214. - name: Download vscode artifact
  215. uses: actions/download-artifact@v3
  216. with:
  217. name: vscode
  218. if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
  219. - name: Build
  220. env:
  221. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  222. npm_config_arch: ${{ matrix.npm_arch }}
  223. run: ./package_linux_reh.sh
  224. if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
  225. - name: Release
  226. env:
  227. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  228. GITHUB_USERNAME: ${{ github.repository_owner }}
  229. run: ./release.sh
  230. if: env.SHOULD_BUILD_REH != 'no' && env.SHOULD_DEPLOY == 'yes'
  231. - name: Upload assets
  232. uses: actions/upload-artifact@v3
  233. with:
  234. name: reh-${{ matrix.vscode_arch }}
  235. path: assets/
  236. retention-days: 3
  237. if: env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  238. aur:
  239. needs:
  240. - check
  241. - build
  242. runs-on: ubuntu-latest
  243. strategy:
  244. fail-fast: false
  245. matrix:
  246. include:
  247. - package_name: vscodium-insiders-bin
  248. - package_name: vscodium-insiders
  249. if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
  250. steps:
  251. - name: Get version
  252. env:
  253. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  254. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> "${GITHUB_ENV}"
  255. - name: Publish ${{ matrix.package_name }}
  256. uses: zokugun/github-actions-aur-releaser@v1
  257. with:
  258. package_name: ${{ matrix.package_name }}
  259. package_version: ${{ env.PACKAGE_VERSION }}
  260. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  261. aur_username: ${{ secrets.AUR_USERNAME }}
  262. aur_email: ${{ secrets.AUR_EMAIL }}
  263. snap:
  264. needs:
  265. - check
  266. - build
  267. runs-on: ubuntu-latest
  268. env:
  269. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  270. strategy:
  271. fail-fast: false
  272. matrix:
  273. platform:
  274. - amd64
  275. - arm64
  276. # if: needs.check.outputs.SHOULD_DEPLOY == 'yes'
  277. if: false
  278. steps:
  279. - uses: actions/checkout@v3
  280. with:
  281. ref: ${{ env.GITHUB_BRANCH }}
  282. - name: Check version
  283. env:
  284. ARCHITECTURE: ${{ matrix.platform }}
  285. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  286. run: ./stores/snapcraft/check_version.sh
  287. - uses: docker/setup-qemu-action@v3
  288. if: env.SHOULD_BUILD == 'yes'
  289. - name: Prepare snapcraft.yaml
  290. env:
  291. ARCHITECTURE: ${{ matrix.platform }}
  292. run: ./stores/snapcraft/build.sh
  293. if: env.SHOULD_BUILD == 'yes'
  294. # - uses: diddlesnaps/snapcraft-multiarch-action@v1
  295. # with:
  296. # path: stores/snapcraft/build
  297. # architecture: ${{ matrix.platform }}
  298. # id: build
  299. # if: env.SHOULD_BUILD == 'yes'
  300. - uses: snapcore/action-build@v1
  301. with:
  302. path: stores/snapcraft/build
  303. id: build
  304. if: env.SHOULD_BUILD == 'yes'
  305. # - uses: diddlesnaps/snapcraft-review-action@v1
  306. # with:
  307. # snap: ${{ steps.build.outputs.snap }}
  308. # isClassic: 'true'
  309. # if: env.SHOULD_BUILD == 'yes'
  310. - uses: svenstaro/upload-release-action@v2
  311. with:
  312. repo_name: ${{ env.ASSETS_REPOSITORY }}
  313. repo_token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  314. file: ${{ steps.build.outputs.snap }}
  315. tag: ${{ env.RELEASE_VERSION }}
  316. if: env.SHOULD_DEPLOY_TO_RELEASE == 'yes'