stable-linux.yml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. schedule:
  12. - cron: '0 18 * * *'
  13. push:
  14. branches: [ master ]
  15. paths-ignore:
  16. - '**/*.md'
  17. pull_request:
  18. branches: [ master ]
  19. paths-ignore:
  20. - '**/*.md'
  21. env:
  22. APP_NAME: VSCodium
  23. ASSETS_REPOSITORY: ${{ github.repository }}
  24. OS_NAME: linux
  25. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  26. VSCODE_QUALITY: stable
  27. jobs:
  28. check:
  29. runs-on: ubuntu-latest
  30. container:
  31. image: vscodium/vscodium-linux-build-agent:bionic-x64
  32. outputs:
  33. MS_COMMIT: ${{ env.MS_COMMIT }}
  34. MS_TAG: ${{ env.MS_TAG }}
  35. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  36. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  37. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  38. steps:
  39. - uses: actions/checkout@v3
  40. with:
  41. ref: ${{ env.GITHUB_BRANCH }}
  42. - name: Clone VSCode repo
  43. run: ./get_repo.sh
  44. - name: Check PR or cron
  45. run: ./check_cron_or_pr.sh
  46. dependencies:
  47. needs:
  48. - check
  49. runs-on: ubuntu-latest
  50. env:
  51. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  52. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  53. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  54. strategy:
  55. fail-fast: false
  56. matrix:
  57. include:
  58. - vscode_arch: x64
  59. image: vscodium/vscodium-linux-build-agent:centos7-devtoolset8-x64
  60. # - vscode_arch: arm64
  61. # image: vscodium/vscodium-linux-build-agent:bionic-x64
  62. container:
  63. image: ${{ matrix.image }}
  64. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  65. steps:
  66. - uses: actions/checkout@v3
  67. with:
  68. ref: ${{ env.GITHUB_BRANCH }}
  69. - name: Clone VSCode repo
  70. run: ./get_repo.sh
  71. - uses: docker/setup-qemu-action@v2
  72. if: matrix.vscode_arch == 'arm64' || matrix.vscode_arch == 'ppc64le'
  73. - name: Setup Node.js environment
  74. uses: actions/setup-node@v3
  75. with:
  76. node-version: '16'
  77. - name: Install Yarn
  78. run: npm install -g yarn
  79. - name: Install remote dependencies (x64)
  80. env:
  81. npm_config_arch: x64
  82. run: ./install_remote_dependencies.sh
  83. if: matrix.vscode_arch == 'x64'
  84. # - name: Install remote dependencies (arm64)
  85. # run: |
  86. # set -e
  87. # docker run -e VSCODE_QUALITY -e GITHUB_TOKEN -v $(pwd):/root/vscodium vscodium/vscodium-linux-build-agent:centos7-devtoolset8-arm64 /root/vscodium/install_remote_dependencies.sh
  88. # if: matrix.vscode_arch == 'arm64'
  89. - name: Save remote dependencies
  90. uses: actions/upload-artifact@v3
  91. with:
  92. name: remote-dependencies-${{ matrix.vscode_arch }}
  93. path: ./remote-dependencies.tar
  94. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  95. build:
  96. needs:
  97. - check
  98. - dependencies
  99. runs-on: ubuntu-latest
  100. env:
  101. DISABLE_UPDATE: 'yes'
  102. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  103. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  104. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  105. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  106. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  107. strategy:
  108. fail-fast: false
  109. matrix:
  110. include:
  111. - vscode_arch: x64
  112. npm_arch: x64
  113. image: vscodium/vscodium-linux-build-agent:bionic-x64
  114. - vscode_arch: arm64
  115. npm_arch: arm64
  116. image: vscodium/vscodium-linux-build-agent:buster-arm64
  117. - vscode_arch: armhf
  118. npm_arch: arm
  119. image: vscodium/vscodium-linux-build-agent:buster-armhf
  120. - vscode_arch: ppc64le
  121. npm_arch: ppc64
  122. image: vscodium/vscodium-linux-build-agent:bionic-ppc64le
  123. container:
  124. image: ${{ matrix.image }}
  125. env:
  126. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  127. outputs:
  128. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  129. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  130. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  131. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  132. steps:
  133. - uses: actions/checkout@v3
  134. - name: Clone VSCode repo
  135. run: ./get_repo.sh
  136. - name: Install GH
  137. run: ./install_gh.sh
  138. - name: Setup Node.js environment
  139. uses: actions/setup-node@v3
  140. with:
  141. node-version: '16'
  142. - name: Install Yarn
  143. run: npm install -g yarn
  144. - name: Check existing VSCodium tags/releases
  145. env:
  146. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  147. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  148. run: ./check_tags.sh
  149. if: env.SHOULD_DEPLOY == 'yes'
  150. - name: Restore remote dependencies
  151. uses: actions/download-artifact@v3
  152. with:
  153. name: remote-dependencies-${{ matrix.vscode_arch }}
  154. if: env.SHOULD_BUILD == 'yes' && matrix.vscode_arch == 'x64'
  155. - name: Build
  156. env:
  157. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  158. npm_config_arch: ${{ matrix.npm_arch }}
  159. run: ./build.sh
  160. if: env.SHOULD_BUILD == 'yes'
  161. - name: Prepare assets
  162. run: ./prepare_assets.sh
  163. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  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@v2
  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