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

Attempt some nix #33

Closed
wants to merge 10 commits into from
67 changes: 6 additions & 61 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,78 +47,23 @@ runs:
echo "Running on supported architecture: ${arch_name}"
fi
shell: bash
- name: Update Homebrew
- uses: DeterminateSystems/nix-installer-action@main
- name: Check nix channel
run: |
echo "::group::Updating Homebrew"
brew update --preinstall
echo "::endgroup::"
shell: bash
- name: Install Lima
env:
GH_TOKEN: ${{ github.token }}
INPUT_LIMA: ${{ inputs.lima }}
run: |
if [ $INPUT_LIMA == "latest" ]
then
LIMA_VERSION=$(gh release -R lima-vm/lima view --json tagName -q ".tagName")
else
LIMA_VERSION=$INPUT_LIMA
fi

echo "::group::Installing Lima version $LIMA_VERSION"
curl -fsSL "https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/lima-${LIMA_VERSION:1}-$(uname -s)-$(uname -m).tar.gz" | tar Cxzvm /usr/local
echo "::endgroup::"
nix-channel --list
nix-channel --update
shell: bash
- name: Install Colima
env:
GH_TOKEN: ${{ github.token }}
INPUT_COLIMA: ${{ inputs.colima }}
run: |
if [ $INPUT_COLIMA == "latest" ]
then
COLIMA_VERSION=$(gh release -R abiosoft/colima view --json tagName -q ".tagName")
else
COLIMA_VERSION=$INPUT_COLIMA
fi

echo "::group::Installing Colima version $COLIMA_VERSION"
curl -LO https://github.com/abiosoft/colima/releases/download/${COLIMA_VERSION}/colima-$(uname)-$(uname -m)

# install in $PATH
install colima-$(uname)-$(uname -m) /usr/local/bin/colima
echo "::endgroup::"
shell: bash
- name: Install QEMU, Docker client, and Docker Compose
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: "1"
run: |
echo "::group::Installing QEMU, Docker client, and Docker Compose"
brew install docker docker-compose qemu 2>&1 | tee install.log
echo "::group::Installing Colima"
nix-env -iA nixpkgs.colima
echo "::endgroup::"
shell: bash
- name: Configure Docker Compose plugin
run: |
mkdir -p ~/.docker/cli-plugins
ln -sfn "$(brew --prefix)/opt/docker-compose/bin/docker-compose" ~/.docker/cli-plugins/docker-compose
shell: bash
- name: Check QEMU version
if: inputs.upgrade-qemu != 'true'
run: |
if grep -q "qemu 8.1.0 is already installed" install.log
then
echo "Detected broken QEMU bottle installed by brew, removing and reinstalling."
brew reinstall qemu
fi
shell: bash
- name: Upgrade QEMU
if: inputs.upgrade-qemu == 'true'
env:
HOMEBREW_NO_AUTO_UPDATE: "1"
HOMEBREW_NO_INSTALL_UPGRADE: "1"
run: brew upgrade qemu
shell: bash
- name: Start Colima
env:
COLIMA_NETWORK_ADDRESS: ${{ inputs.colima-network-address }}
Expand Down
Loading