linux.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. name: linux_build
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. new_release:
  6. type: choice
  7. description: Force new Release
  8. options:
  9. - no
  10. - yes
  11. schedule:
  12. - cron: '0 0 * * *'
  13. push:
  14. pull_request:
  15. branches: [ master ]
  16. jobs:
  17. release:
  18. runs-on: ubuntu-latest
  19. container:
  20. image: ${{ matrix.image }}
  21. env:
  22. OS_NAME: 'linux'
  23. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. include:
  28. - vscode_arch: x64
  29. npm_arch: x64
  30. image: vscodium/vscodium-linux-build-agent:bionic-x64
  31. - vscode_arch: arm64
  32. npm_arch: arm64
  33. image: vscodium/vscodium-linux-build-agent:stretch-arm64
  34. - vscode_arch: armhf
  35. npm_arch: armv7l
  36. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  37. steps:
  38. - uses: actions/checkout@v3
  39. - name: Install GH
  40. run: ./install_gh.sh
  41. - name: Setup Node.js environment
  42. uses: actions/setup-node@v3
  43. with:
  44. node-version: 16
  45. - name: Install Yarn
  46. run: npm install -g yarn
  47. - name: Clone VSCode repo
  48. run: ./get_repo.sh
  49. - name: Check PR or cron
  50. run: ./check_cron_or_pr.sh
  51. - name: Check existing VSCodium tags/releases
  52. env:
  53. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  54. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  55. run: ./check_tags.sh
  56. if: env.SHOULD_DEPLOY == 'yes'
  57. - name: Compute cache key
  58. id: yarnCacheKey
  59. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  60. if: env.SHOULD_BUILD == 'yes'
  61. - name: Get yarn cache directory path
  62. id: yarnCacheDirPath
  63. run: echo "::set-output name=dir::$(yarn cache dir)"
  64. if: env.SHOULD_BUILD == 'yes'
  65. - name: Cache yarn directory
  66. uses: actions/cache@v3
  67. with:
  68. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  69. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  70. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  71. if: env.SHOULD_BUILD == 'yes'
  72. - name: Build
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. npm_config_arch: ${{ matrix.npm_arch }}
  76. run: ./build.sh
  77. if: env.SHOULD_BUILD == 'yes'
  78. - name: Prepare artifacts
  79. run: ./prepare_artifacts.sh
  80. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  81. - name: Release
  82. env:
  83. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  84. run: ./release.sh
  85. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  86. - name: Update versions repo
  87. run: ./update_version.sh
  88. env:
  89. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  90. GITHUB_USERNAME: ${{ github.repository_owner }}
  91. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  92. snap:
  93. needs: release
  94. runs-on: ubuntu-latest
  95. strategy:
  96. fail-fast: false
  97. matrix:
  98. platform:
  99. - amd64
  100. # - arm64
  101. steps:
  102. - uses: actions/checkout@v3
  103. - name: Check version
  104. run: ./stores/snapcraft/check_version.sh
  105. env:
  106. ARCHITECTURE: ${{ matrix.platform }}
  107. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  108. # - uses: docker/setup-qemu-action@v1
  109. # if: env.SHOULD_DEPLOY == 'yes'
  110. # - uses: diddlesnaps/snapcraft-multiarch-action@v1
  111. # with:
  112. # path: stores/snapcraft
  113. # architecture: ${{ matrix.platform }}
  114. # id: build
  115. # if: env.SHOULD_DEPLOY == 'yes'
  116. # - uses: diddlesnaps/snapcraft-review-action@v1
  117. # with:
  118. # snap: ${{ steps.build.outputs.snap }}
  119. # isClassic: 'true'
  120. # if: env.SHOULD_DEPLOY == 'yes'
  121. - uses: snapcore/action-build@v1
  122. with:
  123. path: stores/snapcraft
  124. id: build
  125. if: env.SHOULD_DEPLOY == 'yes'
  126. - uses: snapcore/action-publish@master
  127. env:
  128. SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
  129. with:
  130. snap: ${{ steps.build.outputs.snap }}
  131. release: stable
  132. if: env.SHOULD_DEPLOY == 'yes'