stable-linux.yml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. OS_NAME: linux
  29. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  30. VSCODE_QUALITY: stable
  31. jobs:
  32. check:
  33. runs-on: ubuntu-latest
  34. container:
  35. image: vscodium/vscodium-linux-build-agent:bionic-x64
  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@v3
  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. dependencies:
  55. needs:
  56. - check
  57. runs-on: ubuntu-latest
  58. env:
  59. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  60. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  61. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  62. strategy:
  63. fail-fast: false
  64. matrix:
  65. include:
  66. - vscode_arch: x64
  67. image: vscodium/vscodium-linux-build-agent:centos7-devtoolset8-x64
  68. # - vscode_arch: arm64
  69. # image: vscodium/vscodium-linux-build-agent:centos7-devtoolset8-arm64
  70. container:
  71. image: ${{ matrix.image }}
  72. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  73. steps:
  74. - uses: actions/checkout@v3
  75. with:
  76. ref: ${{ env.GITHUB_BRANCH }}
  77. - name: Clone VSCode repo
  78. # env:
  79. # PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  80. run: ./get_repo.sh
  81. - uses: docker/setup-qemu-action@v3
  82. if: matrix.vscode_arch == 'arm64' || matrix.vscode_arch == 'ppc64le'
  83. - name: Install remote dependencies
  84. run: ./install_remote_dependencies.sh
  85. - name: Save remote dependencies
  86. uses: actions/upload-artifact@v3
  87. with:
  88. name: remote-dependencies-${{ matrix.vscode_arch }}
  89. path: ./remote-dependencies.tar
  90. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  91. build:
  92. needs:
  93. - check
  94. - dependencies
  95. runs-on: ubuntu-latest
  96. env:
  97. DISABLE_UPDATE: 'yes'
  98. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  99. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  100. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  101. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  102. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  103. strategy:
  104. fail-fast: false
  105. matrix:
  106. include:
  107. - vscode_arch: x64
  108. npm_arch: x64
  109. image: vscodium/vscodium-linux-build-agent:bionic-x64
  110. - vscode_arch: arm64
  111. npm_arch: arm64
  112. image: vscodium/vscodium-linux-build-agent:bionic-arm64
  113. - vscode_arch: armhf
  114. npm_arch: arm
  115. image: vscodium/vscodium-linux-build-agent:bionic-armhf
  116. - vscode_arch: ppc64le
  117. npm_arch: ppc64
  118. image: vscodium/vscodium-linux-build-agent:bionic-ppc64le
  119. container:
  120. image: ${{ matrix.image }}
  121. env:
  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'
  128. steps:
  129. - uses: actions/checkout@v3
  130. with:
  131. ref: ${{ env.GITHUB_BRANCH }}
  132. - name: Clone VSCode repo
  133. env:
  134. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  135. run: ./get_repo.sh
  136. - name: Install GH
  137. run: ./install_gh.sh
  138. - name: Check existing VSCodium tags/releases
  139. env:
  140. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  141. run: ./check_tags.sh
  142. if: env.SHOULD_DEPLOY == 'yes'
  143. - name: Restore remote dependencies
  144. uses: actions/download-artifact@v3
  145. with:
  146. name: remote-dependencies-${{ matrix.vscode_arch }}
  147. if: env.SHOULD_BUILD == 'yes' && matrix.vscode_arch == 'x64'
  148. - name: Build
  149. env:
  150. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  151. npm_config_arch: ${{ matrix.npm_arch }}
  152. run: ./build.sh
  153. if: env.SHOULD_BUILD == 'yes'
  154. - name: Prepare assets
  155. run: ./prepare_assets.sh
  156. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  157. - name: Upload assets
  158. uses: actions/upload-artifact@v3
  159. with:
  160. name: assets
  161. path: ./assets/
  162. retention-days: 3
  163. if: env.SHOULD_BUILD == 'yes' && github.event.inputs.generate_assets == 'true'
  164. - name: Release
  165. env:
  166. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  167. run: ./release.sh
  168. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  169. - name: Update versions repo
  170. env:
  171. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  172. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  173. GITHUB_USERNAME: ${{ github.repository_owner }}
  174. run: ./update_version.sh
  175. if: env.SHOULD_DEPLOY == 'yes'
  176. aur:
  177. needs:
  178. - build
  179. runs-on: ubuntu-latest
  180. strategy:
  181. fail-fast: false
  182. matrix:
  183. include:
  184. - package_name: vscodium
  185. package_type: stable
  186. - package_name: vscodium-git
  187. package_type: rolling
  188. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  189. steps:
  190. - name: Publish ${{ matrix.package_name }}
  191. uses: zokugun/github-actions-aur-releaser@v1
  192. with:
  193. package_name: ${{ matrix.package_name }}
  194. package_type: ${{ matrix.package_type }}
  195. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  196. aur_username: ${{ secrets.AUR_USERNAME }}
  197. aur_email: ${{ secrets.AUR_EMAIL }}
  198. snap:
  199. needs:
  200. - build
  201. runs-on: ubuntu-latest
  202. env:
  203. APP_NAME: codium
  204. strategy:
  205. fail-fast: false
  206. matrix:
  207. platform:
  208. - amd64
  209. - arm64
  210. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  211. steps:
  212. - uses: actions/checkout@v3
  213. - name: Check version
  214. env:
  215. ARCHITECTURE: ${{ matrix.platform }}
  216. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  217. run: ./stores/snapcraft/check_version.sh
  218. - uses: docker/setup-qemu-action@v3
  219. if: env.SHOULD_DEPLOY == 'yes'
  220. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  221. with:
  222. path: stores/snapcraft/stable
  223. architecture: ${{ matrix.platform }}
  224. id: build
  225. if: env.SHOULD_DEPLOY == 'yes'
  226. - uses: diddlesnaps/snapcraft-review-action@v1
  227. with:
  228. snap: ${{ steps.build.outputs.snap }}
  229. isClassic: 'true'
  230. if: env.SHOULD_DEPLOY == 'yes'
  231. - uses: snapcore/action-publish@master
  232. env:
  233. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  234. with:
  235. snap: ${{ steps.build.outputs.snap }}
  236. release: stable
  237. if: env.SHOULD_DEPLOY == 'yes'
  238. deb-rpm-repo-hook:
  239. needs:
  240. - build
  241. runs-on: ubuntu-latest
  242. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  243. steps:
  244. - name: Trigger repository rebuild
  245. env:
  246. GL_PAGES_TOKEN: ${{ secrets.GL_PAGES_TOKEN }}
  247. run: curl -X POST --fail -F token="${GL_PAGES_TOKEN}" -F ref=master https://gitlab.com/api/v4/projects/8762263/trigger/pipeline