From ee541dad0aca90e2f0719d344bd3cac223391b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 27 Jan 2022 09:35:53 +0100 Subject: [PATCH] Add minimal configuration for builds.sr.ht --- .build.yml | 19 +++++++++++++++++++ run-ci.sh | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .build.yml create mode 100755 run-ci.sh diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..0963b41 --- /dev/null +++ b/.build.yml @@ -0,0 +1,19 @@ +image: alpine/latest +packages: +- elixir +artifacts: +- ha-handler/_build/prod/rel/ha-handler.tar.gz +sources: +- https://code.recycled.cloud/RecycledCloud/ha-handler.git +tasks: +- setup: | + cd ha-handler + mix local.hex --force + mix local.rebar --force + mix deps.get +- release: | + cd ha-handler + MIX_ENV=prod mix compile + MIX_ENV=prod mix release + cd _build/prod/rel + tar cvzf ha-handler.tar.gz ha_handler/ diff --git a/run-ci.sh b/run-ci.sh new file mode 100755 index 0000000..b03f93e --- /dev/null +++ b/run-ci.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +BUILDS_INSTANCE=https://builds.sr.ht +MANIFEST=.build.yml + +if [ -z "$SRHT_ACCESS_TOKEN" ]; then + echo "Please set SRHT_ACCESS_TOKEN before calling this script." >&2 + exit 1 +fi + +curl \ + -H Authorization:"token $SRHT_ACCESS_TOKEN" \ + --data "manifest=$(jq -R -r --slurp < $MANIFEST)" \ + --data "note=recycledcloud-ha-handler" \ + -X POST $BUILDS_INSTANCE/api/jobs | jq