@@ -52,10 +52,10 @@ runs:
5252 using : ' composite'
5353 steps :
5454 - name : Check Runner OS
55- if : ${{ runner.os != 'Linux' && runner.os != 'Windows' }}
55+ if : ${{ runner.os != 'Linux' && runner.os != 'Windows' && runner.os != 'macOS' }}
5656 shell : bash
5757 run : |
58- echo "::error title=⛔ error hint::Support Linux or Windows Only"
58+ echo "::error title=⛔ error hint::Support Linux, Windows, and macOS Only"
5959 exit 1
6060 - name : Check Auth Info Empty
6161 if : ${{ inputs.authkey == '' && (inputs['oauth-secret'] == '' || inputs.tags == '') }}
@@ -144,8 +144,29 @@ runs:
144144 Start-Process "C:\Windows\System32\msiexec.exe" -Wait -ArgumentList @('/quiet', '/l*v tailscale.log', '/i', 'tailscale.msi')
145145 Add-Content $env:GITHUB_PATH "C:\Program Files\Tailscale\"
146146 Remove-Item tailscale.msi -Force;
147- - name : Start Tailscale Daemon - Linux
148- if : ${{ runner.os == 'Linux' }}
147+ - name : Checkout Tailscale repo - macOS
148+ # TODO: checkout proper tag
149+ if : ${{ runner.os == 'macOS' }}
150+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
151+ with :
152+ repository : tailscale/tailscale
153+ path : ${{ github.workspace }}/tailscale
154+ - name : Build Tailscale binaries - macOS
155+ if : ${{ runner.os == 'macOS' }}
156+ shell : bash
157+ run : |
158+ cd tailscale
159+ export TS_USE_TOOLCHAIN=1
160+ ./build_dist.sh ./cmd/tailscale
161+ ./build_dist.sh ./cmd/tailscaled
162+ sudo mv tailscale tailscaled /usr/local/bin
163+ - name : Install timeout - macOS
164+ if : ${{ runner.os == 'macOS' }}
165+ shell : bash
166+ run :
167+ brew install coreutils # for 'timeout'
168+ - name : Start Tailscale Daemon - non-Windows
169+ if : ${{ runner.os != 'Windows' }}
149170 shell : bash
150171 env :
151172 ADDITIONAL_DAEMON_ARGS : ${{ inputs.tailscaled-args }}
@@ -171,17 +192,22 @@ runs:
171192 TIMEOUT : ${{ inputs.timeout }}
172193 run : |
173194 if [ -z "${HOSTNAME}" ]; then
174- if [ "${{ runner.os }}" == "Linux" ]; then
175- HOSTNAME="github-$(cat /etc/hostname)"
176- elif [ "${{ runner.os }}" == "Windows" ]; then
195+ if [ "${{ runner.os }}" == "Windows" ]; then
177196 HOSTNAME="github-$COMPUTERNAME"
197+ else
198+ HOSTNAME="github-$(hostname)"
178199 fi
179200 fi
180201 if [ -n "${{ inputs['oauth-secret'] }}" ]; then
181202 TAILSCALE_AUTHKEY="${{ inputs['oauth-secret'] }}?preauthorized=true&ephemeral=true"
182203 TAGS_ARG="--advertise-tags=${{ inputs.tags }}"
183204 fi
184- if [ "${{ runner.os }}" == "Linux " ]; then
205+ if [ "${{ runner.os }}" != "Windows " ]; then
185206 MAYBE_SUDO="sudo -E"
186207 fi
187208 timeout --verbose --kill-after=1s ${TIMEOUT} ${MAYBE_SUDO} tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}
209+ - name : Set DNS servers - macOS
210+ if : ${{ runner.os == 'macOS' }}
211+ shell : bash
212+ run :
213+ networksetup -setdnsservers "Ethernet" 100.100.100.100
0 commit comments