linux.yml 4.0 KB

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