-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (97 loc) · 3.23 KB
/
build.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
103
104
105
106
107
108
109
110
111
112
113
114
name: Build
on:
# Allow developers to run this on-demand.
workflow_dispatch:
# Allow the release workflow to trigger this workflow.
workflow_call:
# Validate pull request to confirm that the build is still working.
pull_request:
types:
- opened
- reopened
- synchronize
# Allow at most one instance of this workflow to run at a time.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
# Who to upload the artifacts as.
GIT_USER_NAME: github-actions[bot]
GIT_USER_EMAIL: github-actions[bot]@users.noreply.github.com
# Don't install husky hooks
# https://typicode.github.io/husky/how-to.html#ci-server-and-docker
HUSKY: 0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
# Have to setup node twice as workaround until corepack is supported.
# https://github.com/actions/setup-node/issues/531
- name: Setup Node (corepack-prereq)
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Enable corepack (yarn-prereq)
shell: bash
run: corepack enable
- name: Setup Node and Yarn
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Create .env file from GitHub Secrets
shell: bash
env:
SENTRY_INGEST_DOMAIN: ${{ secrets.SENTRY_INGEST_DOMAIN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_ORG: ${{ github.repository_owner }}
SENTRY_PROJECT: ${{ github.event.repository.name }}
run: |
echo "" > .env
echo "APP_ENV=production" >> .env
echo "LOG_LEVEL=info" >> .env
echo "SENTRY_INGEST_DOMAIN=${SENTRY_INGEST_DOMAIN}" >> .env
echo "SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}" >> .env
echo "SENTRY_DSN=${SENTRY_DSN}" >> .env
echo "SENTRY_ORG=${SENTRY_ORG}" >> .env
echo "SENTRY_PROJECT=${SENTRY_PROJECT}" >> .env
# https://docs.sentry.io/platforms/javascript/guides/electron/configuration/tree-shaking/
echo "__SENTRY_DEBUG__=false" >> .env
echo "__SENTRY_TRACING__=false" >> .env
- name: Install dependencies
shell: bash
run: yarn install --immutable
- name: Build Linux
shell: bash
if: matrix.os == 'ubuntu-latest'
run: yarn build:linux
- name: Build MacOS
shell: bash
if: matrix.os == 'macos-latest'
run: yarn build:mac && yarn sentry:sourcemaps
- name: Build Windows
shell: bash
if: matrix.os == 'windows-latest'
run: yarn build:win
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: phoenix-app-${{ matrix.os }}
path: |
dist/phoenix-*.snap
dist/phoenix-*.deb
dist/phoenix-*.exe
dist/phoenix-*.dmg
dist/phoenix-*.zip
retention-days: 5