requires:
- name: "toolchain"
  category: "development"
  version: ">=0"
env:
  - CGO_ENABLED=0
  - PACKAGE_VERSION={{ .Values.version }}
  - LDFLAGS="-s -w -X 'github.com/kairos-io/provider-kairos/v2/internal/cli.VERSION={{ .Values.version }}'"
prelude:
- git clone https://github.com/kairos-io/provider-kairos
- |
    PACKAGE_VERSION=${PACKAGE_VERSION%\-*} && \
    cd provider-kairos && git checkout v$PACKAGE_VERSION
steps:
- mkdir -p /system/providers
- cd provider-kairos && go build -ldflags "${LDFLAGS}" -o agent-provider-kairos
- mv provider-kairos/agent-provider-kairos /system/providers/agent-provider-kairos
- upx -1 /system/providers/agent-provider-kairos
- ln -s /system/providers/agent-provider-kairos /usr/bin/kairos

includes:
- ^/system$
- ^/system/providers$
- ^/system/providers/agent-provider-kairos$
- ^/usr/bin/kairos$
