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