stable-linux.yml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. name: stable-linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. new_release:
  6. type: boolean
  7. description: Force new Release
  8. schedule:
  9. - cron: '0 18 * * *'
  10. push:
  11. branches: [ master ]
  12. paths-ignore:
  13. - '**/*.md'
  14. pull_request:
  15. branches: [ master ]
  16. paths-ignore:
  17. - '**/*.md'
  18. env:
  19. APP_NAME: VSCodium
  20. ASSETS_REPOSITORY: ${{ github.repository }}
  21. OS_NAME: linux
  22. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  23. VSCODE_QUALITY: stable
  24. jobs:
  25. check:
  26. runs-on: ubuntu-latest
  27. container:
  28. image: vscodium/vscodium-linux-build-agent:bionic-x64
  29. outputs:
  30. MS_COMMIT: ${{ env.MS_COMMIT }}
  31. MS_TAG: ${{ env.MS_TAG }}
  32. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  33. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  34. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  35. steps:
  36. - uses: actions/checkout@v3
  37. with:
  38. ref: ${{ env.GITHUB_BRANCH }}
  39. - name: Clone VSCode repo
  40. run: ./get_repo.sh
  41. - name: Check PR or cron
  42. run: ./check_cron_or_pr.sh
  43. dependencies:
  44. needs:
  45. - check
  46. runs-on: ubuntu-latest
  47. env:
  48. MS_COMMIT: ${{ needs.check.outputs.MS_COMMIT }}
  49. MS_TAG: ${{ needs.check.outputs.MS_TAG }}
  50. RELEASE_VERSION: ${{ needs.check.outputs.RELEASE_VERSION }}
  51. strategy:
  52. fail-fast: false
  53. matrix:
  54. include:
  55. - vscode_arch: x64
  56. image: vscodium/vscodium-linux-build-agent:centos7-devtoolset8-x64
  57. # - vscode_arch: arm64
  58. # image: vscodium/vscodium-linux-build-agent:bionic-x64
  59. container:
  60. image: ${{ matrix.image }}
  61. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  62. steps:
  63. - uses: actions/checkout@v3
  64. with:
  65. ref: ${{ env.GITHUB_BRANCH }}
  66. - name: Clone VSCode repo
  67. run: ./get_repo.sh
  68. - uses: docker/setup-qemu-action@v2
  69. if: matrix.vscode_arch == 'arm64'
  70. - name: Setup Node.js environment
  71. uses: actions/setup-node@v3
  72. with:
  73. node-version: 16
  74. - name: Install Yarn
  75. run: npm install -g yarn
  76. - name: Install remote dependencies (x64)
  77. env:
  78. npm_config_arch: x64
  79. run: ./install_remote_dependencies.sh
  80. if: matrix.vscode_arch == 'x64'
  81. # - name: Install remote dependencies (arm64)
  82. # run: |
  83. # set -e
  84. # 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
  85. # if: matrix.vscode_arch == 'arm64'
  86. - name: Save remote dependencies
  87. uses: actions/upload-artifact@v3
  88. with:
  89. name: remote-dependencies-${{ matrix.vscode_arch }}
  90. path: ./remote-dependencies.tar
  91. retention-days: ${{ needs.check.outputs.SHOULD_DEPLOY == 'yes' && 30 || 1 }}
  92. build:
  93. needs:
  94. - check
  95. - dependencies
  96. runs-on: ubuntu-latest
  97. env:
  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:stretch-arm64
  113. - vscode_arch: armhf
  114. npm_arch: armv7l
  115. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  116. container:
  117. image: ${{ matrix.image }}
  118. env:
  119. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  120. outputs:
  121. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  122. SHOULD_BUILD: ${{ env.SHOULD_BUILD }}
  123. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  124. if: needs.check.outputs.SHOULD_BUILD == 'yes' || needs.check.outputs.SHOULD_DEPLOY == 'yes'
  125. steps:
  126. - uses: actions/checkout@v3
  127. - name: Clone VSCode repo
  128. run: ./get_repo.sh
  129. - name: Install GH
  130. run: ./install_gh.sh
  131. - name: Setup Node.js environment
  132. uses: actions/setup-node@v3
  133. with:
  134. node-version: 16
  135. - name: Install Yarn
  136. run: npm install -g yarn
  137. - name: Check existing VSCodium tags/releases
  138. env:
  139. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  140. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  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'
  157. - name: Release
  158. env:
  159. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  160. run: ./release.sh
  161. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  162. - name: Update versions repo
  163. env:
  164. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  165. GITHUB_USERNAME: ${{ github.repository_owner }}
  166. run: ./update_version.sh
  167. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  168. aur:
  169. needs:
  170. - build
  171. runs-on: ubuntu-latest
  172. strategy:
  173. fail-fast: false
  174. matrix:
  175. include:
  176. - package_name: vscodium
  177. package_type: stable
  178. - package_name: vscodium-git
  179. package_type: rolling
  180. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  181. steps:
  182. - name: Publish ${{ matrix.package_name }}
  183. uses: zokugun/github-actions-aur-releaser@v1
  184. with:
  185. package_name: ${{ matrix.package_name }}
  186. package_type: ${{ matrix.package_type }}
  187. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  188. aur_username: ${{ secrets.AUR_USERNAME }}
  189. aur_email: ${{ secrets.AUR_EMAIL }}
  190. snap:
  191. needs:
  192. - build
  193. runs-on: ubuntu-latest
  194. env:
  195. APP_NAME: codium
  196. strategy:
  197. fail-fast: false
  198. matrix:
  199. platform:
  200. - amd64
  201. - arm64
  202. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  203. steps:
  204. - uses: actions/checkout@v3
  205. - name: Check version
  206. env:
  207. ARCHITECTURE: ${{ matrix.platform }}
  208. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  209. run: ./stores/snapcraft/check_version.sh
  210. - uses: docker/setup-qemu-action@v1
  211. if: env.SHOULD_DEPLOY == 'yes'
  212. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  213. with:
  214. path: stores/snapcraft/stable
  215. architecture: ${{ matrix.platform }}
  216. id: build
  217. if: env.SHOULD_DEPLOY == 'yes'
  218. - uses: diddlesnaps/snapcraft-review-action@v1
  219. with:
  220. snap: ${{ steps.build.outputs.snap }}
  221. isClassic: 'true'
  222. if: env.SHOULD_DEPLOY == 'yes'
  223. - uses: snapcore/action-publish@master
  224. env:
  225. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  226. with:
  227. snap: ${{ steps.build.outputs.snap }}
  228. release: stable
  229. if: env.SHOULD_DEPLOY == 'yes'
  230. deb-rpm-repo-hook:
  231. needs:
  232. - build
  233. runs-on: ubuntu-latest
  234. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  235. steps:
  236. - name: Trigger repository rebuild
  237. env:
  238. GL_PAGES_TOKEN: ${{ secrets.GL_PAGES_TOKEN }}
  239. run: curl -X POST --fail -F token="${GL_PAGES_TOKEN}" -F ref=master https://gitlab.com/api/v4/projects/8762263/trigger/pipeline