linux.yml 4.2 KB

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