@@ -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 }}
@@ -157,10 +178,11 @@ runs:
157178 STATE_ARGS="--statedir=${STATEDIR}"
158179 mkdir -p "$STATEDIR"
159180 fi
160- sudo -E tailscaled ${STATE_ARGS} ${ADDITIONAL_DAEMON_ARGS} 2>~/tailscaled.log &
181+ sudo -E tailscaled ${STATE_ARGS} ${ADDITIONAL_DAEMON_ARGS} 2>&1 | tee ~/tailscaled.log &
161182 # And check that tailscaled came up. The CLI will block for a bit waiting
162183 # for it. And --json will make it exit with status 0 even if we're logged
163184 # out (as we will be). Without --json it returns an error if we're not up.
185+ sleep 30
164186 sudo -E tailscale status --json >/dev/null
165187 - name : Connect to Tailscale
166188 shell : bash
@@ -171,17 +193,22 @@ runs:
171193 TIMEOUT : ${{ inputs.timeout }}
172194 run : |
173195 if [ -z "${HOSTNAME}" ]; then
174- if [ "${{ runner.os }}" == "Linux" ]; then
175- HOSTNAME="github-$(cat /etc/hostname)"
176- elif [ "${{ runner.os }}" == "Windows" ]; then
196+ if [ "${{ runner.os }}" == "Windows" ]; then
177197 HOSTNAME="github-$COMPUTERNAME"
198+ else
199+ HOSTNAME="github-$(hostname)"
178200 fi
179201 fi
180202 if [ -n "${{ inputs['oauth-secret'] }}" ]; then
181203 TAILSCALE_AUTHKEY="${{ inputs['oauth-secret'] }}?preauthorized=true&ephemeral=true"
182204 TAGS_ARG="--advertise-tags=${{ inputs.tags }}"
183205 fi
184- if [ "${{ runner.os }}" == "Linux " ]; then
206+ if [ "${{ runner.os }}" != "Windows " ]; then
185207 MAYBE_SUDO="sudo -E"
186208 fi
187209 timeout --verbose --kill-after=1s ${TIMEOUT} ${MAYBE_SUDO} tailscale up ${TAGS_ARG} --authkey=${TAILSCALE_AUTHKEY} --hostname=${HOSTNAME} --accept-routes ${ADDITIONAL_ARGS}
210+ - name : Set DNS servers - macOS
211+ if : ${{ runner.os == 'macOS' }}
212+ shell : bash
213+ run :
214+ networksetup -setdnsservers "Ethernet" 100.100.100.100
0 commit comments