@@ -10,14 +10,24 @@ inputs:
1010runs :
1111 using : " composite"
1212 steps :
13- - name : Install Twingate
13+ - name : Error if unsupported runner.os
14+ if : runner.os != 'Linux' && runner.os != 'Windows'
15+ shell : bash
16+ run : |
17+ echo "Unsupported Runner OS: ${{ runner.os }}"
18+ exit 1
19+
20+ - name : Install Twingate (Linux)
21+ if : runner.os == 'Linux'
1422 shell : bash
1523 run : |
1624 sudo apt update
1725 echo "deb [trusted=yes] https://packages.twingate.com/apt/ /" | sudo tee /etc/apt/sources.list.d/twingate.list
1826 sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/twingate.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
1927 sudo apt install -yq twingate
20- - name : Setup and start Twingate
28+
29+ - name : Setup and start Twingate (Linux)
30+ if : runner.os == 'Linux'
2131 shell : bash
2232 run : |
2333 echo '${{ inputs.service-key }}' | sudo twingate setup --headless -
5565 if [ $n -eq $MAX_RETRIES ]; then
5666 echo "Twingate service failed to connect."
5767 exit 1
58- fi
68+ fi
69+
70+ - name : Install and Start Twingate (Windows)
71+ if : runner.os == 'Windows'
72+ shell : powershell
73+ run : |
74+ Invoke-WebRequest https://api.twingate.com/download/windows?installer=msi -OutFile .\twingate_client.msi
75+
76+ Set-Content .\key.json '${{ inputs.service-key }}'
77+ $key_path = (Get-Item .\key.json | Resolve-Path).ProviderPath
78+
79+ Start-Process msiexec.exe -Wait -ArgumentList "/i twingate_client.msi service_secret=$key_path /quiet"
80+
81+ Start-Service twingate.service
82+ Start-Sleep -Seconds 10
83+ Get-Service twingate.service
0 commit comments