stable-linux.yml 8.1 KB

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