stable-linux.yml 7.6 KB

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