From 7f641f910e25d060e15614f869a78ccf97ec5ee7 Mon Sep 17 00:00:00 2001 From: Martin Hnatek Date: Sun, 28 Jul 2024 08:30:57 +0200 Subject: [PATCH] feat: commit runner --- .github/osx_build.yaml | 23 +++++++++++++++++++++++ osx/base.pkr.hcl | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/osx_build.yaml create mode 100644 osx/base.pkr.hcl diff --git a/.github/osx_build.yaml b/.github/osx_build.yaml new file mode 100644 index 0000000..8a56af8 --- /dev/null +++ b/.github/osx_build.yaml @@ -0,0 +1,23 @@ +name: osx_build + +on: [push] + +#matrix: +# OSX_VERSION: +# - sonoma +# - ventura +# - monterey + +jobs: + build_image: + runs-on: osx + steps: + - name: Checkout + uses: actions/checkout@v4 + - run: | + export + cd ${{ github.repository }}/osx + packer init . + packer build var macos_version=${OSX_VERSION} . + tart push ${OSX_VERSION}base gitea.hnatekmar.xyz/osx:${OSX_VERSION}latest chunksize 8 + tart prune spacebudget 25 \ No newline at end of file diff --git a/osx/base.pkr.hcl b/osx/base.pkr.hcl new file mode 100644 index 0000000..efc7aea --- /dev/null +++ b/osx/base.pkr.hcl @@ -0,0 +1,34 @@ +packer { + required_plugins { + tart = { + version = ">= 1.11.1" + source = "github.com/cirruslabs/tart" + } + } +} + +variable "macos_version" { + type = string + default = "ventura" +} + +source "tart-cli" "tart" { + vm_base_name = "ghcr.io/cirruslabs/macos-${var.macos_version}-base:latest" + vm_name = "${var.macos_version}-base" + cpu_count = 4 + memory_gb = 4 + disk_size_gb = 50 + ssh_username = "admin" + ssh_password = "admin" + ssh_timeout = "120s" +} + +build { + sources = ["source.tart-cli.tart"] + + provisioner "shell" { + inline = ["mkdir .ssh && echo ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF+vlPAhg+TbppzQhqJ7joeQYU81EphWvyYswBH0oj21 martin@Martins-Mac-mini.local > .ssh/authorized_keys"] + } + + # more provisioners +}