insider-linux.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 7 * * *'
  10. push:
  11. branches: [ insider ]
  12. paths-ignore:
  13. - '**/*.md'
  14. pull_request:
  15. branches: [ insider ]
  16. paths-ignore:
  17. - '**/*.md'
  18. jobs:
  19. release:
  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. steps:
  41. - uses: actions/checkout@v3
  42. with:
  43. ref: insider
  44. - name: Install GH
  45. run: ./install_gh.sh
  46. - name: Setup Node.js environment
  47. uses: actions/setup-node@v3
  48. with:
  49. node-version: 16
  50. - name: Install Yarn
  51. run: npm install -g yarn
  52. - name: Clone VSCode repo
  53. env:
  54. RELEASE_VERSION: ${{ github.event.inputs.release_version }}
  55. run: ./get_repo.sh
  56. - name: Check PR or cron
  57. run: ./check_cron_or_pr.sh
  58. - name: Check existing VSCodium tags/releases
  59. env:
  60. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  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.STRONGER_GITHUB_TOKEN }}
  90. run: ./release.sh
  91. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  92. - name: Update versions repo
  93. run: ./update_version.sh
  94. env:
  95. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  96. GITHUB_USERNAME: ${{ github.repository_owner }}
  97. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  98. snap:
  99. if: ${{ false }} # more testing need to be done after the first release
  100. needs: release
  101. runs-on: ubuntu-latest
  102. env:
  103. VSCODE_QUALITY: 'insider'
  104. strategy:
  105. fail-fast: false
  106. matrix:
  107. platform:
  108. - amd64
  109. - arm64
  110. steps:
  111. - uses: actions/checkout@v3
  112. with:
  113. ref: insider
  114. - name: Check version
  115. run: ./stores/snapcraft/check_version.sh
  116. env:
  117. ARCHITECTURE: ${{ matrix.platform }}
  118. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  119. - uses: docker/setup-qemu-action@v1
  120. if: env.SHOULD_DEPLOY == 'yes'
  121. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  122. with:
  123. path: stores/snapcraft/insider
  124. architecture: ${{ matrix.platform }}
  125. id: build
  126. if: env.SHOULD_DEPLOY == 'yes'
  127. - uses: diddlesnaps/snapcraft-review-action@v1
  128. with:
  129. snap: ${{ steps.build.outputs.snap }}
  130. isClassic: 'true'
  131. if: env.SHOULD_DEPLOY == 'yes'
  132. - uses: snapcore/action-publish@master
  133. env:
  134. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  135. with:
  136. snap: ${{ steps.build.outputs.snap }}
  137. release: stable
  138. if: env.SHOULD_DEPLOY == 'yes'