#!/bin/sh VERSION=`cat module.json | jq -r '.version'` TMP_DIR=`mktemp -d` GITEA_TOKEN=`secret-tool lookup Title 'Gitea Token'` FOLDER="${TMP_DIR}/the_beguiler_module_${VERSION}" sh ./json_to_nedb.sh mkdir "${FOLDER}" cp -r languages README.md module.json modules "${FOLDER}/" mkdir "${FOLDER}/packs" cp packs/*.db "${FOLDER}/packs" zip -r "${TMP_DIR}/the_beguiler_module.zip" "${FOLDER}" curl --user "histausse:${GITEA_TOKEN}" \ --upload-file "${TMP_DIR}/the_beguiler_module.zip" \ "https://git.mineau.eu/api/packages/histausse/generic/the_beguiler_module/${VERSION}/the_beguiler_module.zip" rm -rf "${TMP_DIR}"