insider-windows.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. name: insider-windows
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. release_version:
  6. type: string
  7. description: Forced release version
  8. new_release:
  9. type: boolean
  10. description: Force new Release
  11. schedule:
  12. - cron: '0 8 * * *'
  13. push:
  14. branches: [ insider ]
  15. paths-ignore:
  16. - '**/*.md'
  17. pull_request:
  18. branches: [ insider ]
  19. paths-ignore:
  20. - '**/*.md'
  21. env:
  22. APP_NAME: VSCodium
  23. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  24. GITHUB_BRANCH: insider
  25. OS_NAME: windows
  26. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  27. VSCODE_QUALITY: insider
  28. jobs:
  29. build:
  30. runs-on: windows-2019
  31. defaults:
  32. run:
  33. shell: bash
  34. env:
  35. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. vscode_arch:
  40. - x64
  41. - ia32
  42. - arm64
  43. outputs:
  44. RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
  45. SHOULD_DEPLOY: ${{ env.SHOULD_DEPLOY }}
  46. steps:
  47. - uses: actions/checkout@v3
  48. with:
  49. ref: ${{ env.GITHUB_BRANCH }}
  50. - name: Setup Node.js environment
  51. uses: actions/setup-node@v3
  52. with:
  53. node-version: 16
  54. - name: Install Yarn
  55. run: npm install -g yarn
  56. - name: Setup Python 3
  57. uses: actions/setup-python@v3
  58. with:
  59. python-version: '3.x'
  60. - name: Clone VSCode repo
  61. env:
  62. RELEASE_VERSION: ${{ github.event.inputs.release_version }}
  63. run: ./get_repo.sh
  64. - name: Check PR or cron
  65. run: ./check_cron_or_pr.sh
  66. - name: Check existing VSCodium tags/releases
  67. env:
  68. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  69. NEW_RELEASE: ${{ github.event.inputs.new_release }}
  70. run: ./check_tags.sh
  71. if: env.SHOULD_DEPLOY == 'yes'
  72. - name: Build
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. npm_config_arch: ${{ matrix.vscode_arch }}
  76. npm_config_target_arch: ${{ matrix.vscode_arch }}
  77. run: ./build.sh
  78. if: env.SHOULD_BUILD == 'yes'
  79. - name: Prepare assets
  80. run: ./prepare_assets.sh
  81. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  82. - name: Release
  83. env:
  84. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  85. GITHUB_USERNAME: ${{ github.repository_owner }}
  86. run: ./release.sh
  87. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  88. - name: Update versions repo
  89. env:
  90. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  91. GITHUB_USERNAME: ${{ github.repository_owner }}
  92. run: ./update_version.sh
  93. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  94. winget:
  95. needs: build
  96. runs-on: windows-latest
  97. defaults:
  98. run:
  99. shell: bash
  100. env:
  101. APP_IDENTIFIER: VSCodium.VSCodium.Insiders
  102. ASSETS_REPOSITORY: vscodium-insiders
  103. if: needs.build.outputs.SHOULD_DEPLOY == 'yes'
  104. steps:
  105. - uses: actions/checkout@v3
  106. with:
  107. ref: ${{ env.GITHUB_BRANCH }}
  108. - name: Check version
  109. run: ./stores/winget/check_version.sh
  110. env:
  111. RELEASE_VERSION: ${{ needs.build.outputs.RELEASE_VERSION }}
  112. - name: Release to WinGet
  113. uses: vedantmgoyal2009/winget-releaser@v1
  114. with:
  115. identifier: ${{ env.APP_IDENTIFIER }}
  116. version: ${{ env.RELEASE_VERSION }}
  117. release-repository: ${{ env.ASSETS_REPOSITORY }}
  118. release-tag: ${{ env.RELEASE_VERSION }}-insider
  119. installers-regex: '\.exe$' # only .exe files
  120. token: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  121. if: env.SHOULD_DEPLOY == 'yes'