From 46a1add70f80d1405d95d91a273772436b5dd048 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Wed, 1 Jan 2025 20:22:21 -0600 Subject: [PATCH] Github Actions for macOS builds --- .github/workflows/build-macos.yaml | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/build-macos.yaml diff --git a/.github/workflows/build-macos.yaml b/.github/workflows/build-macos.yaml new file mode 100644 index 0000000000..050c0feab4 --- /dev/null +++ b/.github/workflows/build-macos.yaml @@ -0,0 +1,63 @@ +name: Build for macOS + +on: + workflow_dispatch: + branches: master + +jobs: + build: + strategy: + matrix: + os: [macos-15-arm64, macos-15] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - name: Cache NodeJS modules + uses: actions/cache@v4 + with: + path: | + ./node_modules + ./app/node_modules + key: ${{ runner.OS }}-node-${{ hashFiles('yarn.lock') }}-${{ hashFiles('app/package-lock.json') }} + + - name: Install Dependencies + run: npm ci + + - name: Setup Codesigning + uses: apple-actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.APPLE_CODESIGN_P12 }} + p12-password: ${{ secrets.APPLE_CODESIGN_KEY_PASSWORD }} + + - name: Setup AWS CLI + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Lint + run: npm run lint + + - name: Build + run: SIGN_BUILD=true DEBUG=electron-packager,electron-osx-sign,electron-notarize* npm run build + env: + APPLE_ID_ASC_PROVIDER: ${{ secrets.APPLE_ID_ASC_PROVIDER }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + APPLE_ID: ${{ secrets.APPLE_ID }} + + - name: Rename artifacts + if: matrix.os == 'macos-15-arm64' + run: | + mv app/dist/Mailspring.zip app/dist/Mailspring-AppleSilicon.zip + + - name: Sync artifacts to S3 bucket + run: | + aws s3 sync app/dist/ "s3://mailspring-builds/client/$(git rev-parse --short HEAD)/osx" \ + --acl public-read \ + --exclude "*" --include *.zip