stable-windows.yml 4.0 KB

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