insider-macos.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. name: insider-macos
  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: [insider]
  16. push:
  17. branches: [ insider ]
  18. paths-ignore:
  19. - '**/*.md'
  20. - 'upstream/*.json'
  21. pull_request:
  22. branches: [ insider ]
  23. paths-ignore:
  24. - '**/*.md'
  25. env:
  26. APP_NAME: VSCodium
  27. ASSETS_REPOSITORY: ${{ github.repository }}-insiders
  28. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  29. OS_NAME: osx
  30. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  31. VSCODE_QUALITY: insider
  32. jobs:
  33. build:
  34. runs-on: ${{ matrix.runner }}
  35. env:
  36. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. include:
  41. - runner: macos-13
  42. vscode_arch: x64
  43. - runner: [self-hosted, macOS, ARM64]
  44. vscode_arch: arm64
  45. steps:
  46. - uses: actions/checkout@v4
  47. with:
  48. ref: ${{ env.GITHUB_BRANCH }}
  49. - name: Switch to relevant branch
  50. env:
  51. PULL_REQUEST_ID: ${{ github.event.inputs.checkout_pr }}
  52. run: . get_pr.sh
  53. - name: Setup Node.js environment
  54. uses: actions/setup-node@v4
  55. with:
  56. node-version: '20.18.2'
  57. - name: Setup Python 3
  58. uses: actions/setup-python@v5
  59. with:
  60. python-version: '3.11'
  61. if: env.VSCODE_ARCH == 'x64'
  62. - name: Clone VSCode repo
  63. run: . get_repo.sh
  64. - name: Check PR or cron
  65. env:
  66. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  67. run: . check_cron_or_pr.sh
  68. - name: Check existing VSCodium tags/releases
  69. env:
  70. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  71. run: . check_tags.sh
  72. if: env.SHOULD_DEPLOY == 'yes'
  73. - name: Build
  74. env:
  75. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  76. run: ./build.sh
  77. if: env.SHOULD_BUILD == 'yes'
  78. - name: Prepare assets
  79. env:
  80. CERTIFICATE_OSX_APP_PASSWORD: ${{ secrets.CERTIFICATE_OSX_NEW_APP_PASSWORD }}
  81. CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_NEW_ID }}
  82. CERTIFICATE_OSX_P12_DATA: ${{ secrets.CERTIFICATE_OSX_NEW_P12_DATA }}
  83. CERTIFICATE_OSX_P12_PASSWORD: ${{ secrets.CERTIFICATE_OSX_NEW_P12_PASSWORD }}
  84. CERTIFICATE_OSX_TEAM_ID: ${{ secrets.CERTIFICATE_OSX_NEW_TEAM_ID }}
  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.STRONGER_GITHUB_TOKEN }}
  90. GITHUB_USERNAME: ${{ github.repository_owner }}
  91. run: ./release.sh
  92. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  93. - name: Update versions repo
  94. env:
  95. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  96. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  97. GITHUB_USERNAME: ${{ github.repository_owner }}
  98. run: ./update_version.sh
  99. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  100. - name: Upload assets
  101. uses: actions/upload-artifact@v4
  102. with:
  103. name: bin-${{ matrix.vscode_arch }}
  104. path: assets/
  105. retention-days: 3
  106. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  107. - name: Clean up keychain
  108. if: always()
  109. run: |
  110. KEYCHAIN=$RUNNER_TEMP/build.keychain
  111. if [ -f "$KEYCHAIN" ];
  112. then
  113. security delete-keychain $KEYCHAIN
  114. fi