Skip to content

Commit

Permalink
Github Actions for macOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bengotow committed Jan 2, 2025
1 parent f4903cc commit 1a8284d
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build for Linux

on:
workflow_dispatch:
branches: master

jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:18.04

steps:
- name: Install deps
run: |
apt-get update -y
apt install -y software-properties-common
apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
apt install -y nodejs autoconf automake build-essential clang cmake execstack fakeroot g++-5 git libc-ares-dev libctemplate-dev libcurl4-openssl-dev libglib2.0-dev libgnome-keyring-dev libicu-dev libsasl2-dev libsasl2-modules libsasl2-modules-gssapi-mit libsecret-1-dev libssl-dev libnss3 libnss3-dev libtidy-dev libtool libxext-dev libxkbfile-dev libxml2-dev libxtst-dev rpm uuid-dev xvfb
- name: Checkout Repo
uses: actions/checkout@v3

- name: Cache NodeJS modules
uses: actions/cache@v4
with:
path: |
./node_modules
./app/node_modules
key: ubuntu-deps-${{ hashFiles('yarn.lock') }}-${{ hashFiles('app/package-lock.json') }}

- name: Install Dependencies
run: npm ci

- 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: DEBUG=electron-packager npm run build

- uses: snapcore/action-build@v1
id: build

- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge

- 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
64 changes: 64 additions & 0 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build for macOS

on:
workflow_dispatch:
branches: master

jobs:
build:
strategy:
matrix:
# Confusingly, macos-13 is intel and macos-latest is ARM
os: [macos-13, macos-latest]

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: ${{ matrix.os }}-deps-${{ 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-latest'
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

0 comments on commit 1a8284d

Please sign in to comment.