linux.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. linux:
  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. vscode_arch: [x64, arm64, armhf]
  21. include:
  22. - vscode_arch: x64
  23. npm_arch: x64
  24. image: vscodium/vscodium-linux-build-agent:bionic-x64
  25. - vscode_arch: arm64
  26. npm_arch: arm64
  27. image: vscodium/vscodium-linux-build-agent:stretch-arm64
  28. - vscode_arch: armhf
  29. npm_arch: armv7l
  30. image: vscodium/vscodium-linux-build-agent:stretch-armhf
  31. steps:
  32. - uses: actions/checkout@v2
  33. - name: Setup Node.js environment
  34. uses: actions/setup-node@v1
  35. with:
  36. node-version: 12.14.1
  37. - name: Install Yarn
  38. run: npm install -g yarn
  39. - name: Check PR or cron
  40. run: ./check_cron_or_pr.sh
  41. - name: Clone VSCode repo
  42. run: ./get_repo.sh
  43. - name: Check existing VSCodium tags/releases
  44. env:
  45. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  46. run: ./check_tags.sh
  47. if: env.SHOULD_DEPLOY == 'yes'
  48. - name: Compute cache key
  49. id: yarnCacheKey
  50. run: echo "::set-output name=value::$(node build/azure-pipelines/computeYarnCacheKey.js)"
  51. if: env.SHOULD_BUILD == 'yes'
  52. - name: Get yarn cache directory path
  53. id: yarnCacheDirPath
  54. run: echo "::set-output name=dir::$(yarn cache dir)"
  55. if: env.SHOULD_BUILD == 'yes'
  56. - name: Cache yarn directory
  57. uses: actions/cache@v2
  58. with:
  59. path: ${{ steps.yarnCacheDirPath.outputs.dir }}
  60. key: linux-${{ matrix.npm_arch }}-yarnCacheDir-${{ steps.yarnCacheKey.outputs.value }}
  61. restore-keys: linux-${{ matrix.npm_arch }}-yarnCacheDir-
  62. if: env.SHOULD_BUILD == 'yes'
  63. - name: Build
  64. env:
  65. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  66. npm_config_arch: ${{ matrix.npm_arch }}
  67. run: ./build.sh
  68. if: env.SHOULD_BUILD == 'yes'
  69. - name: Zip release
  70. run: |
  71. cd VSCode-linux-${VSCODE_ARCH}
  72. tar czf ../VSCodium-linux-${VSCODE_ARCH}-${LATEST_MS_TAG}.tar.gz .
  73. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  74. - name: Generate shasums
  75. run: ./sum.sh
  76. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  77. - name: Release
  78. uses: softprops/action-gh-release@v1
  79. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  80. with:
  81. tag_name: ${{ env.LATEST_MS_TAG }}
  82. files: |
  83. ./*.sha256
  84. ./*.zip
  85. ./*.tar.gz
  86. ./*.deb
  87. ./*.rpm
  88. ./VSCodium-*.AppImage
  89. ./VSCodium-*.AppImage.zsync
  90. env:
  91. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  92. - name: Update versions repo
  93. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  94. run: ./update_version.sh
  95. env:
  96. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  97. GITHUB_USERNAME: ${{ github.repository_owner }}