insider-macos.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. BINARY_NAME: codium-insiders
  29. GITHUB_BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'insider' }}
  30. GH_REPO_PATH: ${{ github.repository }}
  31. ORG_NAME: ${{ github.repository_owner }}
  32. OS_NAME: osx
  33. VERSIONS_REPOSITORY: ${{ github.repository_owner }}/versions
  34. VSCODE_QUALITY: insider
  35. jobs:
  36. build:
  37. runs-on: ${{ matrix.runner }}
  38. env:
  39. VSCODE_ARCH: ${{ matrix.vscode_arch }}
  40. strategy:
  41. fail-fast: false
  42. matrix:
  43. include:
  44. - runner: macos-13
  45. vscode_arch: x64
  46. - runner: [self-hosted, macOS, ARM64]
  47. vscode_arch: arm64
  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.19.0'
  60. - name: Setup Python 3
  61. uses: actions/setup-python@v5
  62. with:
  63. python-version: '3.11'
  64. if: env.VSCODE_ARCH == 'x64'
  65. - name: Clone VSCode repo
  66. run: . get_repo.sh
  67. - name: Check PR or cron
  68. env:
  69. GENERATE_ASSETS: ${{ github.event.inputs.generate_assets }}
  70. run: . check_cron_or_pr.sh
  71. - name: Check existing VSCodium tags/releases
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. run: . check_tags.sh
  75. if: env.SHOULD_DEPLOY == 'yes'
  76. - name: Build
  77. env:
  78. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  79. run: ./build.sh
  80. if: env.SHOULD_BUILD == 'yes'
  81. - name: Prepare assets
  82. env:
  83. CERTIFICATE_OSX_APP_PASSWORD: ${{ secrets.CERTIFICATE_OSX_NEW_APP_PASSWORD }}
  84. CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_NEW_ID }}
  85. CERTIFICATE_OSX_P12_DATA: ${{ secrets.CERTIFICATE_OSX_NEW_P12_DATA }}
  86. CERTIFICATE_OSX_P12_PASSWORD: ${{ secrets.CERTIFICATE_OSX_NEW_P12_PASSWORD }}
  87. CERTIFICATE_OSX_TEAM_ID: ${{ secrets.CERTIFICATE_OSX_NEW_TEAM_ID }}
  88. run: ./prepare_assets.sh
  89. if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true')
  90. - name: Release
  91. env:
  92. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  93. GITHUB_USERNAME: ${{ github.repository_owner }}
  94. run: ./release.sh
  95. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  96. - name: Update versions repo
  97. env:
  98. FORCE_UPDATE: ${{ github.event.inputs.force_version }}
  99. GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
  100. GITHUB_USERNAME: ${{ github.repository_owner }}
  101. run: ./update_version.sh
  102. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
  103. - name: Upload assets
  104. uses: actions/upload-artifact@v4
  105. with:
  106. name: bin-${{ matrix.vscode_arch }}
  107. path: assets/
  108. retention-days: 3
  109. if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'no' && github.event.inputs.generate_assets == 'true'
  110. - name: Clean up keychain
  111. if: always()
  112. run: |
  113. KEYCHAIN=$RUNNER_TEMP/build.keychain
  114. if [ -f "$KEYCHAIN" ];
  115. then
  116. security delete-keychain $KEYCHAIN
  117. fi