Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: no macOS support #103

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 16 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,15 @@ 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 coreutils go
echo "PATH=$(go env GOROOT)/bin:$(go env GOPATH)/bin:$PATH" >> $GITHUB_ENV # Export PATH to GitHub Actions environment
- name: Install Tailscale
shell: bash
run: go install tailscale.com/cmd/tailscale{,d}@v1.68.2
- name: Start Tailscale Daemon
shell: bash
env:
Expand All @@ -109,7 +119,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