Skip to content
Open
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
30 changes: 25 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: 'Enable debug output'
required: false
default: "false"
cache:
description: 'Enable caching of Twingate packages to speed up installation'
required: false
default: "true"
runs:
using: "composite"
steps:
Expand All @@ -21,14 +25,30 @@ runs:
echo "Unsupported Runner OS: ${{ runner.os }}"
exit 1

- name: Install Twingate (Linux)
if: runner.os == 'Linux'
- name: Get latest Twingate version
if: runner.os == 'Linux' && inputs.cache == 'true'
id: twingate-version
shell: bash
run: |
sudo apt update
VERSION=$(curl -s https://packages.twingate.com/apt/Packages | awk '/^Version:/ {print $2}' | sort -V | tail -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Latest Twingate version: $VERSION"
echo "deb [trusted=yes] https://packages.twingate.com/apt/ /" | sudo tee /etc/apt/sources.list.d/twingate.list
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/twingate.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo apt install -yq twingate

- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
with:
packages: twingate
version: ${{ steps.twingate-version.outputs.version }}
debug: true

# - name: Install Twingate (Linux)
# if: runner.os == 'Linux'
# shell: bash
# run: |
# sudo apt update
# echo "deb [trusted=yes] https://packages.twingate.com/apt/ /" | sudo tee /etc/apt/sources.list.d/twingate.list
# sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/twingate.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
# sudo apt install -yq twingate

- name: Setup and start Twingate (Linux)
if: runner.os == 'Linux'
Expand Down
Loading