2
0

stable-linux.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. jobs:
  19. build:
  20. runs-on: ubuntu-latest
  21. container:
  22. image: ${{ matrix.image }}
  23. env:
  24. OS_NAME: 'linux'
  25. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  26. VSCODE_QUALITY: 'stable'
  27. strategy:
  28. fail-fast: false
  29. matrix:
  30. include:
  31. - vscode_arch: x64
  32. npm_arch: x64
  33. image: vscodium/vscodium-linux-build-agent:bionic-x64
  34. - vscode_arch: arm64
  35. npm_arch: arm64
  36. image: vscodium/vscodium-linux-build-agent:stretch-arm64
  37. - vscode_arch: armhf
  38. npm_arch: armv7l
  39. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  40. outputs:
  41. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  42. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  43. steps:
  44. - uses: actions/checkout@v3
  45. - name: Install GH
  46. run: ./install_gh.sh
  47. - name: Setup Node.js environment
  48. uses: actions/setup-node@v3
  49. with:
  50. node-version: 16
  51. - name: Install Yarn
  52. run: npm install -g yarn
  53. - name: Clone VSCode repo
  54. run: ./get_repo.sh
  55. - name: Check PR or cron
  56. run: ./check_cron_or_pr.sh
  57. - name: Check existing VSCodium tags/releases
  58. env:
  59. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  60. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  61. run: ./check_tags.sh
  62. if: env.SHOULD_DEPLOY == 'yes'
  63. - name: Compute cache key
  64. id: yarnCacheKey
  65. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  66. if: env.SHOULD_BUILD == 'yes'
  67. - name: Get yarn cache directory path
  68. id: yarnCacheDirPath
  69. run: echo "::set-output name=dir::$(yarn cache dir)"
  70. if: env.SHOULD_BUILD == 'yes'
  71. - name: Cache yarn directory
  72. uses: actions/cache@v3
  73. with:
  74. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  75. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  76. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  77. if: env.SHOULD_BUILD == 'yes'
  78. - name: Build
  79. env:
  80. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  81. npm_config_arch: ${{ matrix.npm_arch }}
  82. run: ./build.sh
  83. if: env.SHOULD_BUILD == 'yes'
  84. - name: Prepare artifacts
  85. run: ./prepare_artifacts.sh
  86. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  87. - name: Release
  88. env:
  89. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  90. run: ./release.sh
  91. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  92. - name: Update versions repo
  93. env:
  94. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  95. GITHUB_USERNAME: ${{ github.repository_owner }}
  96. run: ./update_version.sh
  97. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  98. aur:
  99. needs: build
  100. runs-on: ubuntu-latest
  101. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  102. steps:
  103. - name: Get version
  104. env:
  105. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  106. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> $GITHUB_ENV
  107. - name: Publish vscodium
  108. uses: zokugun/github-actions-aur-releaser@v1
  109. with:
  110. package_name: vscodium
  111. package_version: ${{ env.PACKAGE_VERSION }}
  112. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  113. aur_username: ${{ secrets.AUR_USERNAME }}
  114. aur_email: ${{ secrets.AUR_EMAIL }}
  115. - name: Publish vscodium-git
  116. uses: zokugun/github-actions-aur-releaser@v1
  117. with:
  118. package_name: vscodium-git
  119. package_type: rolling
  120. package_version: ${{ env.PACKAGE_VERSION }}
  121. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  122. aur_username: ${{ secrets.AUR_USERNAME }}
  123. aur_email: ${{ secrets.AUR_EMAIL }}
  124. snap:
  125. needs: build
  126. runs-on: ubuntu-latest
  127. strategy:
  128. fail-fast: false
  129. matrix:
  130. platform:
  131. - amd64
  132. - arm64
  133. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  134. steps:
  135. - uses: actions/checkout@v3
  136. - name: Check version
  137. run: ./stores/snapcraft/check_version.sh
  138. env:
  139. ARCHITECTURE: ${{ matrix.platform }}
  140. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  141. - uses: docker/setup-qemu-action@v1
  142. if: env.SHOULD_DEPLOY == 'yes'
  143. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  144. with:
  145. path: stores/snapcraft/stable
  146. architecture: ${{ matrix.platform }}
  147. id: build
  148. if: env.SHOULD_DEPLOY == 'yes'
  149. - uses: diddlesnaps/snapcraft-review-action@v1
  150. with:
  151. snap: ${{ steps.build.outputs.snap }}
  152. isClassic: 'true'
  153. if: env.SHOULD_DEPLOY == 'yes'
  154. - uses: snapcore/action-publish@master
  155. env:
  156. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  157. with:
  158. snap: ${{ steps.build.outputs.snap }}
  159. release: stable
  160. if: env.SHOULD_DEPLOY == 'yes'