diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 07f2b31..233906e 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -6,6 +6,8 @@ on: branches: - main pull_request: + schedule: + - cron: "14 14 * * 1-5" permissions: contents: read pull-requests: read diff --git a/Justfile b/Justfile index 934f785..c523f5a 100644 --- a/Justfile +++ b/Justfile @@ -7,14 +7,19 @@ packages *ARGS: ./packages.cr \ --to "s3://devx?secret-key=hydra_key&endpoint=${S3_ENDPOINT}®ion=auto&compression=zstd" \ --from-store https://cache.iog.io \ - --nix-store "${NIX_STORE}" \ --systems x86_64-linux # Based on releases.json, upload the CA contents and update packages.json ci: - just rclone copy s3://devx/capkgs cache + @just cache-download just packages - just rclone sync cache s3://devx/capkgs + @just cache-upload + +cache-download: + @just rclone copy s3://devx/capkgs cache + +cache-upload: + @just rclone sync cache s3://devx/capkgs rclone *ARGS: #!/usr/bin/env nu diff --git a/packages.cr b/packages.cr index 0178e39..42c4e19 100755 --- a/packages.cr +++ b/packages.cr @@ -7,7 +7,6 @@ require "file_utils" class Config property from_store : String? property to : String? - property nix_store : String? property systems : Array(String)? def parse @@ -17,7 +16,6 @@ class Config parser.on "--from-store=URL", "Public cache URL that users fetch closures from" { |v| @from_store = v } parser.on "--to=URL", "Nix store URL to copy CA outputs to" { |v| @to = v } parser.on "--systems=A,B", "systems to process" { |v| @systems = v.split.map(&.strip) } - parser.on "--nix-store=STORE", "store URI" { |v| @nix_store = v } parser.on "-h", "--help", "Show this help" do puts parser @@ -28,18 +26,16 @@ class Config raise "Missing required flag: --from-store" unless from_store_value = @from_store raise "Missing required flag: --to" unless to_value = @to raise "Missing required flag: --systems" unless systems_value = @systems - raise "Missing required flag: --nix-store" unless nix_store_value = @nix_store - Valid.new(from_store_value, to_value, systems_value, nix_store_value) + Valid.new(from_store_value, to_value, systems_value) end struct Valid property from_store : String property to : String property systems : Array(String) - property nix_store : String - def initialize(@from_store, @to, @systems, @nix_store) + def initialize(@from_store, @to, @systems) end end end