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

{action.yml,.github}: add support for windows #160

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

mpminardi
Copy link
Member

Add support for running the action on windows-based GitHub runners.

Updates #157

@mpminardi mpminardi self-assigned this Feb 25, 2025
action.yml Outdated
if [ "{{ runner.os }}" == "Linux" ]; then
HOSTNAME="github-$(cat /etc/hostname)"
elif [ "{{ runner.os }}" == "Windows" ]; then
HOSTNAME="github-$COMPUTERNAME"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing $s in front of the braces

Suggested change
if [ "{{ runner.os }}" == "Linux" ]; then
HOSTNAME="github-$(cat /etc/hostname)"
elif [ "{{ runner.os }}" == "Windows" ]; then
HOSTNAME="github-$COMPUTERNAME"
fi
if [ "${{ runner.os }}" == "Linux" ]; then
HOSTNAME="github-$(cat /etc/hostname)"
elif [ "${{ runner.os }}" == "Windows" ]; then
HOSTNAME="github-$COMPUTERNAME"
fi

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks, good catch!

@mpminardi mpminardi force-pushed the mpminardi/windows-support branch from 07c60d3 to c29cd81 Compare February 25, 2025 15:21
@mpminardi mpminardi marked this pull request as ready for review February 26, 2025 16:59
action.yml Outdated
VERSION=$(curl -s "https://pkgs.tailscale.com/stable/?mode=json" | jq -r .Version)
echo "Latest Tailscale version: $VERSION"
fi
if [ X64 = "ARM64" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this X64 variable? Shouldn't it be runner.arch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yup definitely should be, will fix.

@mpminardi mpminardi force-pushed the mpminardi/windows-support branch from c29cd81 to 5be1273 Compare February 26, 2025 17:51
Copy link
Contributor

@oxtoacart oxtoacart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of nitpicky suggestions.

action.yml Outdated
TS_ARCH="arm64"
elif [ ${{ runner.arch }} = "X86" ]; then
TS_ARCH="x86"
elif [ ${{ runner.arch }} = "X64" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: given the below else, you could skip this one.

action.yml Outdated
SHA256SUM: ${{ inputs.sha256sum }}
run: |
if [ "$VERSION" = "latest" ]; then
VERSION=$(curl -s "https://pkgs.tailscale.com/stable/?mode=json" | jq -r .Version)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed you used -H user-agent:tailscale-github-action in a curl further down. Want to do it here too?

URL="https://pkgs.tailscale.com/unstable/tailscale-setup-${VERSION}-${TS_ARCH}.msi"
fi
echo "Downloading $URL"
curl -H user-agent:tailscale-github-action -L "$URL" -o tailscale.msi --max-time 300 --fail
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the custom user-agent here!

Add support for running the action on windows-based GitHub runners.

Updates #157
@mpminardi mpminardi force-pushed the mpminardi/windows-support branch from 5be1273 to 5dddea1 Compare March 3, 2025 19:37
@dblohm7 dblohm7 self-requested a review March 5, 2025 19:42
@mpminardi mpminardi merged commit d32d855 into main Mar 13, 2025
2 checks passed
@mpminardi mpminardi deleted the mpminardi/windows-support branch March 13, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants