stable-linux.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. 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. needs: build
  100. runs-on: ubuntu-latest
  101. strategy:
  102. fail-fast: false
  103. matrix:
  104. platform:
  105. - amd64
  106. - arm64
  107. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  108. steps:
  109. - uses: actions/checkout@v3
  110. - name: Check version
  111. run: ./stores/snapcraft/check_version.sh
  112. env:
  113. ARCHITECTURE: ${{ matrix.platform }}
  114. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  115. - uses: docker/setup-qemu-action@v1
  116. if: env.SHOULD_DEPLOY == 'yes'
  117. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  118. with:
  119. path: stores/snapcraft/stable
  120. architecture: ${{ matrix.platform }}
  121. id: build
  122. if: env.SHOULD_DEPLOY == 'yes'
  123. - uses: diddlesnaps/snapcraft-review-action@v1
  124. with:
  125. snap: ${{ steps.build.outputs.snap }}
  126. isClassic: 'true'
  127. if: env.SHOULD_DEPLOY == 'yes'
  128. - uses: snapcore/action-publish@master
  129. env:
  130. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  131. with:
  132. snap: ${{ steps.build.outputs.snap }}
  133. release: stable
  134. if: env.SHOULD_DEPLOY == 'yes'