stable-linux.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. 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: '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. steps:
  41. - uses: actions/checkout@v3
  42. - name: Install GH
  43. run: ./install_gh.sh
  44. - name: Setup Node.js environment
  45. uses: actions/setup-node@v3
  46. with:
  47. node-version: 16
  48. - name: Install Yarn
  49. run: npm install -g yarn
  50. - name: Clone VSCode repo
  51. run: ./get_repo.sh
  52. - name: Check PR or cron
  53. run: ./check_cron_or_pr.sh
  54. - name: Check existing VSCodium tags/releases
  55. env:
  56. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  57. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  58. run: ./check_tags.sh
  59. if: env.SHOULD_DEPLOY == 'yes'
  60. - name: Compute cache key
  61. id: yarnCacheKey
  62. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  63. if: env.SHOULD_BUILD == 'yes'
  64. - name: Get yarn cache directory path
  65. id: yarnCacheDirPath
  66. run: echo "::set-output name=dir::$(yarn cache dir)"
  67. if: env.SHOULD_BUILD == 'yes'
  68. - name: Cache yarn directory
  69. uses: actions/cache@v3
  70. with:
  71. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  72. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  73. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  74. if: env.SHOULD_BUILD == 'yes'
  75. - name: Build
  76. env:
  77. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  78. npm_config_arch: ${{ matrix.npm_arch }}
  79. run: ./build.sh
  80. if: env.SHOULD_BUILD == 'yes'
  81. - name: Prepare artifacts
  82. run: ./prepare_artifacts.sh
  83. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  84. - name: Release
  85. env:
  86. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  87. run: ./release.sh
  88. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  89. - name: Update versions repo
  90. run: ./update_version.sh
  91. env:
  92. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  93. GITHUB_USERNAME: ${{ github.repository_owner }}
  94. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  95. snap:
  96. needs: release
  97. runs-on: ubuntu-latest
  98. strategy:
  99. fail-fast: false
  100. matrix:
  101. platform:
  102. - amd64
  103. - arm64
  104. steps:
  105. - uses: actions/checkout@v3
  106. - name: Check version
  107. run: ./stores/snapcraft/check_version.sh
  108. env:
  109. ARCHITECTURE: ${{ matrix.platform }}
  110. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  111. - uses: docker/setup-qemu-action@v1
  112. if: env.SHOULD_DEPLOY == 'yes'
  113. - uses: diddlesnaps/snapcraft-multiarch-action@v1
  114. with:
  115. path: stores/snapcraft/stable
  116. architecture: ${{ matrix.platform }}
  117. id: build
  118. if: env.SHOULD_DEPLOY == 'yes'
  119. - uses: diddlesnaps/snapcraft-review-action@v1
  120. with:
  121. snap: ${{ steps.build.outputs.snap }}
  122. isClassic: 'true'
  123. if: env.SHOULD_DEPLOY == 'yes'
  124. - uses: snapcore/action-publish@master
  125. env:
  126. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  127. with:
  128. snap: ${{ steps.build.outputs.snap }}
  129. release: stable
  130. if: env.SHOULD_DEPLOY == 'yes'