stable-linux.yml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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'
  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. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  102. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  103. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  104. SHOULD_BUILD: ${{ needs.check.outputs.SHOULD_BUILD }}
  105. SHOULD_DEPLOY: ${{ needs.check.outputs.SHOULD_DEPLOY }}
  106. strategy:
  107. fail-fast: false
  108. matrix:
  109. include:
  110. - vscode_arch: x64
  111. npm_arch: x64
  112. image: vscodium/vscodium-linux-build-agent:bionic-x64
  113. - vscode_arch: arm64
  114. npm_arch: arm64
  115. image: vscodium/vscodium-linux-build-agent:stretch-arm64
  116. - vscode_arch: armhf
  117. npm_arch: armv7l
  118. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  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. - name: Clone VSCode repo
  131. run: ./get_repo.sh
  132. - name: Install GH
  133. run: ./install_gh.sh
  134. - name: Setup Node.js environment
  135. uses: actions/setup-node@v3
  136. with:
  137. node-version: 16
  138. - name: Install Yarn
  139. run: npm install -g yarn
  140. - name: Check existing VSCodium tags/releases
  141. env:
  142. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  143. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  144. run: ./check_tags.sh
  145. if: env.SHOULD_DEPLOY == 'yes'
  146. - name: Restore remote dependencies
  147. uses: actions/download-artifact@v3
  148. with:
  149. name: remote-dependencies-${{ matrix.vscode_arch }}
  150. if: env.SHOULD_BUILD == 'yes' && matrix.vscode_arch == 'x64'
  151. - name: Build
  152. env:
  153. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  154. npm_config_arch: ${{ matrix.npm_arch }}
  155. run: ./build.sh
  156. if: env.SHOULD_BUILD == 'yes'
  157. - name: Prepare assets
  158. run: ./prepare_assets.sh
  159. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  160. - name: Release
  161. env:
  162. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  163. run: ./release.sh
  164. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  165. - name: Update versions repo
  166. env:
  167. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  168. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  169. GITHUB_USERNAME: ${{ github.repository_owner }}
  170. run: ./update_version.sh
  171. if: env.SHOULD_DEPLOY == 'yes'
  172. aur:
  173. needs:
  174. - build
  175. runs-on: ubuntu-latest
  176. strategy:
  177. fail-fast: false
  178. matrix:
  179. include:
  180. - package_name: vscodium
  181. package_type: stable
  182. - package_name: vscodium-git
  183. package_type: rolling
  184. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  185. steps:
  186. - name: Publish ${{ matrix.package_name }}
  187. uses: zokugun/github-actions-aur-releaser@v1
  188. with:
  189. package_name: ${{ matrix.package_name }}
  190. package_type: ${{ matrix.package_type }}
  191. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  192. aur_username: ${{ secrets.AUR_USERNAME }}
  193. aur_email: ${{ secrets.AUR_EMAIL }}
  194. snap:
  195. needs:
  196. - build
  197. runs-on: ubuntu-latest
  198. env:
  199. APP_NAME: codium
  200. strategy:
  201. fail-fast: false
  202. matrix:
  203. platform:
  204. - amd64
  205. - arm64
  206. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  207. steps:
  208. - uses: actions/checkout@v3
  209. - name: Check version
  210. env:
  211. ARCHITECTURE: ${{ matrix.platform }}
  212. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  213. run: ./stores/snapcraft/check_version.sh
  214. - uses: docker/setup-qemu-action@v2
  215. if: env.SHOULD_DEPLOY == 'yes'
  216. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  217. with:
  218. path: stores/snapcraft/stable
  219. architecture: ${{ matrix.platform }}
  220. id: build
  221. if: env.SHOULD_DEPLOY == 'yes'
  222. - uses: diddlesnaps/snapcraft-review-action@v1
  223. with:
  224. snap: ${{ steps.build.outputs.snap }}
  225. isClassic: 'true'
  226. if: env.SHOULD_DEPLOY == 'yes'
  227. - uses: snapcore/action-publish@master
  228. env:
  229. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  230. with:
  231. snap: ${{ steps.build.outputs.snap }}
  232. release: stable
  233. if: env.SHOULD_DEPLOY == 'yes'
  234. deb-rpm-repo-hook:
  235. needs:
  236. - build
  237. runs-on: ubuntu-latest
  238. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  239. steps:
  240. - name: Trigger repository rebuild
  241. env:
  242. GL_PAGES_TOKEN: ${{ secrets.GL_PAGES_TOKEN }}
  243. run: curl -X POST --fail -F token="${GL_PAGES_TOKEN}" -F ref=master https://gitlab.com/api/v4/projects/8762263/trigger/pipeline