# TODO: reuse common steps using YAML anchors # partial YAML anchors support got added in early Aug 2025, see https://github.com/actions/runner/issues/1182 # but defining a block of steps under a single anchor is still not supported name: 'GitHub Actions CI' on: { push: { branches: [master] }, pull_request: { branches: [master] } } env: { ELECTRON_MAIL_NODE_VERSION: 22, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 } jobs: build-proton-clients: if: github.event_name == 'push' strategy: { matrix: { os: [ubuntu-22.04] }, fail-fast: false } runs-on: ${{ matrix.os }} steps: - &common-step_checkout uses: actions/checkout@v4 - &common-step_setup-pnpm uses: pnpm/action-setup@v4 with: { version: 'latest' } - &common-step_setup-node uses: actions/setup-node@v4 with: { node-version: '${{ env.ELECTRON_MAIL_NODE_VERSION }}', cache: 'pnpm' } - &common-step_setup-python uses: actions/setup-python@v5 with: { python-version: '3.14.0' } - &common-step_envinfo name: envinfo run: npx envinfo - &common-step_install-node-modules name: install node modules run: 'pnpm install --frozen-lockfile --reporter=append-only' - name: cache artifact uses: actions/cache@v4 with: path: | ./output/git/backup ./app/assets/db-search-monaco-editor key: "proton-clients-cache-${{ hashFiles('./src/shared/const/proton-apps.ts') }}-${{ secrets.PROTON_CLIENTS_ARTIFACT_CACHE_VERSION }}" - { name: print ./output/git/backup files, shell: bash, run: ./scripts/ci/list-fs-content.sh ./output/git/backup } - { name: build, run: ./scripts/ci/prepare-webclients.sh } - { name: print ./output/git/backup files, shell: bash, run: ./scripts/ci/list-fs-content.sh ./output/git/backup } - { name: tar artifact, run: tar -cvf proton-clients-artifact.tar ./output/git/backup ./app/assets/db-search-monaco-editor } - uses: actions/upload-artifact@v4 with: { name: proton-clients-artifact, path: ./proton-clients-artifact.tar, if-no-files-found: error } build-app: strategy: { matrix: { os: [ubuntu-22.04, windows-2022, macos-latest] }, fail-fast: false } runs-on: ${{ matrix.os }} steps: - *common-step_checkout - *common-step_setup-pnpm - *common-step_setup-node - *common-step_setup-python - *common-step_envinfo - *common-step_install-node-modules - { name: build, run: 'npm exec --package=npm-run-all -- npm-run-all lint build' } - { name: print ./app files, shell: bash, run: ./scripts/ci/list-fs-content.sh ./app } - uses: actions/upload-artifact@v4 with: { name: 'app-artifact-${{ runner.os }}', path: ./app, if-no-files-found: error } package-app: if: github.event_name == 'push' needs: [build-proton-clients, build-app] strategy: { matrix: { os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2022, windows-11-arm, macos-15-intel, macos-latest] }, fail-fast: false } runs-on: ${{ matrix.os }} steps: - *common-step_checkout - *common-step_setup-pnpm - *common-step_setup-node - *common-step_setup-python - *common-step_envinfo - *common-step_install-node-modules - { name: download proton clients artifact, uses: actions/download-artifact@v4, with: { name: proton-clients-artifact } } - { name: unpack proton clients artifact, shell: bash, run: tar -xvf ./proton-clients-artifact.tar } - { name: download app artifact, uses: actions/download-artifact@v4, with: { name: 'app-artifact-${{ runner.os }}', path: ./app } } - { name: assets, run: 'yarn assets', env: { ELECTRON_MAIL_SHOULD_FAIL_ON_BUILD: 'true' } } - { name: print ./app files, shell: bash, run: ./scripts/ci/list-fs-content.sh ./app } - { name: build, if: runner.os == 'Windows', run: ./scripts/ci/github/package-app.ps1 } - name: build native deps using "ubuntu:20.04" docker image if: runner.os == 'Linux' run: | set -e pnpm run clean:prebuilds docker run --rm \ -v ${{ github.workspace }}:/host \ -w /tmp \ -e ELECTRON_MAIL_NODE_VERSION=${{ env.ELECTRON_MAIL_NODE_VERSION }} \ -e GITHUB_REPOSITORY=${{ github.repository }} \ -e GITHUB_SHA=${{ github.sha }} \ ubuntu:20.04 bash -c "/host/scripts/ci/github/prepare-native-deps-docker.sh" - { name: build, if: runner.os == 'Linux', run: ./scripts/ci/github/package-app-linux.sh } - name: build if: matrix.os == 'macos-15-intel' run: ./scripts/ci/github/package-app-osx.sh env: { ELECTRON_MAIL_NODE_DEST_ARCH: 'x64' } - name: build if: matrix.os == 'macos-latest' run: ./scripts/ci/github/package-app-osx.sh env: { ELECTRON_MAIL_NODE_DEST_ARCH: 'arm64' } - name: upload e2e output if: ${{ always() }} uses: actions/upload-artifact@v4 with: { name: 'output-e2e-artifact-${{ matrix.os }}', path: ./output/e2e }