insider-linux.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. name: insider-linux
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. release_version:
  6. type: string
  7. description: Forced release version
  8. schedule:
  9. - cron: '0 8 * * *'
  10. push:
  11. branches: [ insider ]
  12. paths-ignore:
  13. - '**/*.md'
  14. pull_request:
  15. branches: [ insider ]
  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: 'insider'
  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. with:
  46. ref: insider
  47. - name: Install GH
  48. run: ./install_gh.sh
  49. - name: Setup Node.js environment
  50. uses: actions/setup-node@v3
  51. with:
  52. node-version: 16
  53. - name: Install Yarn
  54. run: npm install -g yarn
  55. - name: Clone VSCode repo
  56. env:
  57. RELEASE_VERSION: ${{ github.event.inputs.release_version }}
  58. run: ./get_repo.sh
  59. - name: Check PR or cron
  60. run: ./check_cron_or_pr.sh
  61. - name: Check existing VSCodium tags/releases
  62. env:
  63. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  64. run: ./check_tags.sh
  65. if: env.SHOULD_DEPLOY == 'yes'
  66. - name: Compute cache key
  67. id: yarnCacheKey
  68. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  69. if: env.SHOULD_BUILD == 'yes'
  70. - name: Get yarn cache directory path
  71. id: yarnCacheDirPath
  72. run: echo "::set-output name=dir::$(yarn cache dir)"
  73. if: env.SHOULD_BUILD == 'yes'
  74. - name: Cache yarn directory
  75. uses: actions/cache@v3
  76. with:
  77. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  78. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  79. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  80. if: env.SHOULD_BUILD == 'yes'
  81. - name: Build
  82. env:
  83. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  84. npm_config_arch: ${{ matrix.npm_arch }}
  85. run: ./build.sh
  86. if: env.SHOULD_BUILD == 'yes'
  87. - name: Prepare artifacts
  88. run: ./prepare_artifacts.sh
  89. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  90. - name: Release
  91. env:
  92. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  93. GITHUB_USERNAME: ${{ github.repository_owner }}
  94. run: ./release.sh
  95. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  96. - name: Update versions repo
  97. env:
  98. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  99. GITHUB_USERNAME: ${{ github.repository_owner }}
  100. run: ./update_version.sh
  101. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  102. aur:
  103. needs: build
  104. runs-on: ubuntu-latest
  105. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  106. steps:
  107. - name: Get version
  108. env:
  109. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  110. run: echo "PACKAGE_VERSION=${RELEASE_VERSION/-*/}" >> $GITHUB_ENV
  111. - name: Publish vscodium-insiders-bin
  112. uses: zokugun/github-actions-aur-releaser@v1
  113. with:
  114. package_name: vscodium-insiders-bin
  115. package_version: ${{ env.PACKAGE_VERSION }}
  116. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  117. aur_username: ${{ secrets.AUR_USERNAME }}
  118. aur_email: ${{ secrets.AUR_EMAIL }}
  119. - name: Publish vscodium-insiders
  120. uses: zokugun/github-actions-aur-releaser@v1
  121. with:
  122. package_name: vscodium-insiders
  123. package_version: ${{ env.PACKAGE_VERSION }}
  124. aur_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
  125. aur_username: ${{ secrets.AUR_USERNAME }}
  126. aur_email: ${{ secrets.AUR_EMAIL }}
  127. snap:
  128. needs: build
  129. runs-on: ubuntu-latest
  130. env:
  131. VSCODE_QUALITY: 'insider'
  132. strategy:
  133. fail-fast: false
  134. matrix:
  135. platform:
  136. - amd64
  137. - arm64
  138. # if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  139. if: ${{ false }}
  140. steps:
  141. - uses: actions/checkout@v3
  142. with:
  143. ref: insider
  144. - name: Check version
  145. run: ./stores/snapcraft/check_version.sh
  146. env:
  147. ARCHITECTURE: ${{ matrix.platform }}
  148. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  149. - uses: docker/setup-qemu-action@v1
  150. if: env.SHOULD_DEPLOY == 'yes'
  151. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  152. with:
  153. path: stores/snapcraft/insider
  154. architecture: ${{ matrix.platform }}
  155. id: build
  156. if: env.SHOULD_DEPLOY == 'yes'
  157. - uses: diddlesnaps/snapcraft-review-action@v1
  158. with:
  159. snap: ${{ steps.build.outputs.snap }}
  160. isClassic: 'true'
  161. if: env.SHOULD_DEPLOY == 'yes'
  162. - uses: snapcore/action-publish@master
  163. env:
  164. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  165. with:
  166. snap: ${{ steps.build.outputs.snap }}
  167. release: edge
  168. if: env.SHOULD_DEPLOY == 'yes'