Skip to content

Commit

Permalink
Merge branch 'release/v0.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Mar 1, 2024
2 parents c464eaa + c912be5 commit ade1b66
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.arch }}-distrobuilder-3.0
key: ${{ runner.arch }}-distrobuilder-main

- uses: actions/setup-go@v5
if: steps.cache-distrobuilder.outputs.cache-hit != 'true'
Expand All @@ -45,7 +45,7 @@ runs:
sudo apt-get install -y git make
mkdir -p ~/go/src/github.com/lxc/
cd ~/go/src/github.com/lxc/
git clone --depth 1 --branch distrobuilder-3.0 https://github.com/lxc/distrobuilder
git clone --depth 1 --branch main https://github.com/lxc/distrobuilder
cd ./distrobuilder
make
Expand Down Expand Up @@ -82,14 +82,14 @@ runs:
uses: actions/cache@v4
with:
path: ~/.mix
key: ${{ runner.arch }}-icepak-0.1.3
key: ${{ runner.arch }}-icepak-0.1.4

- name: Install Pakman
if: steps.cache-icepak.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix escript.install hex icepak 0.1.3 --force
mix escript.install hex icepak 0.1.4 --force
shell: alpine.sh {0}
env:
MIX_ENV: prod
16 changes: 12 additions & 4 deletions lib/icepak/item.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ defmodule Icepak.Item do
combined_hashes: []

@combinations %{
"combined_squashfs_sha256" => ["incus.tar.xz", "rootfs.squashfs"]
"combined_squashfs_sha256" => ["incus.tar.xz", "rootfs.squashfs"],
"combined_disk-kvm-img_sha256" => ["incus.tar.xz", "disk.qcow2"]
}

@file_types %{
"rootfs.squashfs" => "squashfs",
"disk.qcow2" => "disk-kvm.img"
}

defmodule Hash do
Expand Down Expand Up @@ -84,7 +90,7 @@ defmodule Icepak.Item do
]
end

def prepare("rootfs.squashfs" = file, %{base_path: base_path, storage_path: storage_path}) do
def prepare(file, %{base_path: base_path, storage_path: storage_path}) do
hash_ref = :crypto.hash_init(:sha256)
full_path = Path.join(base_path, file)
%{size: size} = File.stat!(full_path)
Expand All @@ -96,10 +102,12 @@ defmodule Icepak.Item do
|> calculate_hash(hash_ref)
|> finalize_hash()

file_type = Map.fetch!(@file_types, file)

[
%__MODULE__{
name: "root.squashfs",
file_type: "squashfs",
name: file,
file_type: file_type,
size: size,
hash: hash,
path: storage_path,
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Icepak.MixProject do
def project do
[
app: :icepak,
version: "0.1.3",
version: "0.1.4",
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit ade1b66

Please sign in to comment.