|
| 1 | +name: Build for macOS |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + branches: master |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + # Confusingly, macos-13 is intel and macos-latest is ARM |
| 12 | + os: [macos-13, macos-latest] |
| 13 | + |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout Repo |
| 18 | + uses: actions/checkout@v3 |
| 19 | + |
| 20 | + - name: Cache NodeJS modules |
| 21 | + uses: actions/cache@v4 |
| 22 | + with: |
| 23 | + path: | |
| 24 | + ./node_modules |
| 25 | + ./app/node_modules |
| 26 | + key: ${{ matrix.os }}-deps-${{ hashFiles('yarn.lock') }}-${{ hashFiles('app/package-lock.json') }} |
| 27 | + |
| 28 | + - name: Install Dependencies |
| 29 | + run: npm ci |
| 30 | + |
| 31 | + - name: Setup Codesigning |
| 32 | + uses: apple-actions/import-codesign-certs@v3 |
| 33 | + with: |
| 34 | + p12-file-base64: ${{ secrets.APPLE_CODESIGN_P12 }} |
| 35 | + p12-password: ${{ secrets.APPLE_CODESIGN_KEY_PASSWORD }} |
| 36 | + |
| 37 | + - name: Setup AWS CLI |
| 38 | + uses: aws-actions/configure-aws-credentials@v1 |
| 39 | + with: |
| 40 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 41 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 42 | + aws-region: us-east-1 |
| 43 | + |
| 44 | + - name: Lint |
| 45 | + run: npm run lint |
| 46 | + |
| 47 | + - name: Build |
| 48 | + run: SIGN_BUILD=true DEBUG=electron-packager,electron-osx-sign,electron-notarize* npm run build |
| 49 | + env: |
| 50 | + APPLE_ID_ASC_PROVIDER: ${{ secrets.APPLE_ID_ASC_PROVIDER }} |
| 51 | + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} |
| 52 | + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} |
| 53 | + APPLE_ID: ${{ secrets.APPLE_ID }} |
| 54 | + |
| 55 | + - name: Rename artifacts |
| 56 | + if: matrix.os == 'macos-latest' |
| 57 | + run: | |
| 58 | + mv app/dist/Mailspring.zip app/dist/Mailspring-AppleSilicon.zip |
| 59 | +
|
| 60 | + - name: Sync artifacts to S3 bucket |
| 61 | + run: | |
| 62 | + aws s3 sync app/dist/ "s3://mailspring-builds/client/$(git rev-parse --short HEAD)/osx" \ |
| 63 | + --acl public-read \ |
| 64 | + --exclude "*" --include *.zip |
0 commit comments