-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (101 loc) · 3.96 KB
/
Copy pathbuild-macos.yml
File metadata and controls
121 lines (101 loc) · 3.96 KB
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
115
116
117
118
119
120
121
name: Build macOS
# Reusable macOS build:
# - called from release.yml on tag push,
# - or triggered manually from the Actions UI (workflow_dispatch).
# Runs the full ExUnit suite on macOS (arm64) and produces the signed DMG
# artifact that release.yml uploads to the GitHub Release.
#
# macos-26 = Apple Silicon (M-series), latest Xcode preinstalled (26.6 as of
# this writing — priv/macos/src/*.swift needs its toolchain for Swift 6 language mode
# / strict concurrency checking). GitHub bills macOS runners 10x vs Linux, so
# this workflow deliberately does not run on every PR — only on tags or
# on-demand dispatch.
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-macos-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Test and package (macOS arm64)
runs-on: macos-26
timeout-minutes: 45
env:
MIX_ENV: dev
steps:
- name: Check out WebUI
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install SwiftLint
run: brew install swiftlint
- name: Lint Swift launcher source (priv/macos/src)
# Static analysis for the one piece of this repo that isn't
# Elixir/Phoenix and so isn't covered by `mix format`/`mix quality`.
# Runs before the Elixir toolchain is even set up so a style
# regression fails fast without burning macOS-runner minutes (billed
# 10x vs Linux) on a compile that was never going to matter.
run: swiftlint lint --strict
- name: Install Erlang and Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1
with:
version-file: .tool-versions
version-type: strict
- name: Restore Mix cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.mix
~/.cache/rebar3
deps
_build
key: mix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.tool-versions', 'mix.lock') }}
restore-keys: |
mix-${{ runner.os }}-${{ runner.arch }}-
- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force
- name: Fetch dependencies
run: mix deps.get
- name: Compile (dev)
run: mix compile --warnings-as-errors
- name: Compile (test)
env:
MIX_ENV: test
run: mix compile --warnings-as-errors
- name: Run macOS test suite
env:
MIX_ENV: test
run: perl -e 'alarm shift; exec @ARGV' 60 mix test
- name: Run macOS Launch Services integration tests
# Excluded from the suite above (test/test_helper.exs) because these
# shell out to `swiftc` to build priv/macos/src/*.swift for real,
# which needs Xcode and is slower than the rest of the suite. Opted
# back in explicitly here so the launcher's own output contract and
# the "Set as default" banner flow get exercised on every macOS
# release. They are read-only with respect to the host's default
# handlers — see test/macos/launcher_integration_test.exs for why
# nothing here tries to actually take the .torrent default over.
env:
MIX_ENV: test
run: perl -e 'alarm shift; exec @ARGV' 60 mix test --only macos_integration
- name: Build DMG (prod release + .app + signed DMG)
run: mix mac.dmg
- name: Compute SHA-256 checksum
working-directory: dist
run: |
shopt -s nullglob
for dmg in *.dmg; do
shasum -a 256 "$dmg" | tee "$dmg.sha256"
done
- name: Upload macOS artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: macos-arm64
path: |
dist/*.dmg
dist/*.dmg.sha256
if-no-files-found: error
retention-days: 30