Skip to content

Commit

Permalink
Problem: no macOS support
Browse files Browse the repository at this point in the history
Solution: install tailscale from homebrew
  • Loading branch information
yrashk committed Jan 3, 2024
1 parent 7a0b30e commit acfb679
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tailscale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v2
Expand Down
13 changes: 11 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:
using: 'composite'
steps:
- name: Check Runner OS
if: ${{ runner.os != 'Linux' }}
if: ${{ runner.os != 'Linux' && runner.os != 'macOS' }}
shell: bash
run: |
echo "::error title=⛔ error hint::Support Linux Only"
Expand All @@ -56,6 +56,7 @@ runs:
echo "::error title=⛔ error hint::OAuth identity empty, Maybe you need to populate it in the Secrets for your workflow, see more in https://docs.github.com/en/actions/security-guides/encrypted-secrets and https://tailscale.com/s/oauth-clients"
exit 1
- name: Download Tailscale
if: ${{ runner.os == 'Linux' }}
shell: bash
id: download
env:
Expand Down Expand Up @@ -90,6 +91,10 @@ runs:
rm tailscale.tgz
TSPATH=/tmp/tailscale_${VERSION}_${TS_ARCH}
sudo mv "${TSPATH}/tailscale" "${TSPATH}/tailscaled" /usr/bin
- name: Download Tailscale
if: ${{ runner.os == 'macOS' }}
shell: bash
run: brew install tailscale coreutils # timeout comes with coreutils
- name: Start Tailscale Daemon
shell: bash
env:
Expand All @@ -109,7 +114,11 @@ runs:
TS_EXPERIMENT_OAUTH_AUTHKEY: true
run: |
if [ -z "${HOSTNAME}" ]; then
HOSTNAME="github-$(cat /etc/hostname)"
if [ -f /etc/hostname ]; then
HOSTNAME="github-$(cat /etc/hostname)"
else
HOSTNAME="github-$(hostname)"
fi
fi
if [ -n "${{ inputs['oauth-secret'] }}" ]; then
TAILSCALE_AUTHKEY="${{ inputs['oauth-secret'] }}?preauthorized=true&ephemeral=true"
Expand Down

0 comments on commit acfb679

Please sign in to comment.