-
Notifications
You must be signed in to change notification settings - Fork 100
102 lines (101 loc) · 6.08 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# TODO use YAML anchors or custom "composing GitHub action" to avoid code duplication (none of these options currently supported), see:
# - https://github.com/actions/runner/issues/438
# - https://github.com/actions/runner/issues/646
name: 'GitHub Actions CI'
on: { push: { branches: [master] }, pull_request: { branches: [master] } }
env: { ELECTRON_MAIL_NODE_VERSION: 20, PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 }
jobs:
build-proton-clients:
if: github.event_name == 'push'
strategy: { matrix: { os: [ubuntu-20.04] }, fail-fast: false }
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/checkout@v4 }
- { uses: pnpm/action-setup@v4, with: { version: 'latest' } }
- { name: pnpm patch, if: runner.os == 'Windows', run: ./scripts/ci/github/patch-pnpm.ps1 }
- { uses: actions/setup-node@v4, with: { node-version: '${{ env.ELECTRON_MAIL_NODE_VERSION }}', cache: 'pnpm' } }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- { name: install node-gyp, if: runner.os == 'Windows', run: ./scripts/ci/github/install-node-gyp.ps1 }
- { uses: actions/setup-python@v5, with: { python-version: '3.9' } }
- { name: envinfo, run: npx envinfo }
- { name: install node modules, run: 'pnpm install --frozen-lockfile --reporter=append-only' }
# </common>
- 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 }
- {
name: upload artifact,
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-20.04, windows-2019, macos-12] }, fail-fast: false }
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/checkout@v4 }
- { uses: pnpm/action-setup@v4, with: { version: 'latest' } }
- { name: pnpm patch, if: runner.os == 'Windows', run: ./scripts/ci/github/patch-pnpm.ps1 }
- { uses: actions/setup-node@v4, with: { node-version: '${{ env.ELECTRON_MAIL_NODE_VERSION }}', cache: 'pnpm' } }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- { name: install node-gyp, if: runner.os == 'Windows', run: ./scripts/ci/github/install-node-gyp.ps1 }
- { uses: actions/setup-python@v5, with: { python-version: '3.9' } }
- { name: envinfo, run: npx envinfo }
- { name: install node modules, run: 'pnpm install --frozen-lockfile --reporter=append-only' }
# </common>
- { 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 }
- {
name: upload artifact,
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-20.04, windows-2019, macos-12, macos-latest] }, fail-fast: false }
runs-on: ${{ matrix.os }}
steps:
# <common> TODO use YAML anchors feature when it gets supported
- { uses: actions/checkout@v4 }
- { uses: pnpm/action-setup@v4, with: { version: 'latest' } }
- { name: pnpm patch, if: runner.os == 'Windows', run: ./scripts/ci/github/patch-pnpm.ps1 }
- { uses: actions/setup-node@v4, with: { node-version: '${{ env.ELECTRON_MAIL_NODE_VERSION }}', cache: 'pnpm' } }
- { name: system setup, if: runner.os == 'Linux', run: ./scripts/ci/github/system-setup-linux.sh }
- { name: install node-gyp, if: runner.os == 'Windows', run: ./scripts/ci/github/install-node-gyp.ps1 }
- { uses: actions/setup-python@v5, with: { python-version: '3.9' } }
- { name: envinfo, run: npx envinfo }
- { name: install node modules, run: 'pnpm install --frozen-lockfile --reporter=append-only' }
# </common>
- { 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, if: runner.os == 'Linux', run: ./scripts/ci/github/package-app-linux.sh }
- {
name: build,
if: matrix.os == 'macos-12',
run: ./scripts/ci/github/package-app-osx.sh,
env: { MACOSX_DEPLOYMENT_TARGET: '10.10' },
}
- {
name: build,
if: matrix.os == 'macos-latest',
run: ./scripts/ci/github/package-app-osx.sh,
env: { MACOSX_DEPLOYMENT_TARGET: '11.0', ELECTRON_DEST_MAIL_ARCH: 'arm64' },
}
- name: upload e2e/spectron output
if: ${{ always() }}
uses: actions/upload-artifact@v4
with: { name: 'output-e2e-artifact-${{ matrix.os }}', path: ./output/e2e }