This only adds a lint task, as indentation is yet to be finalized. It
will not fail build if there are lint errors. This is to allow gradual
move to stricter and appropriate checks.
The lint task uses an undocumented mechanism of builds.sr.ht to stop
the build and call it successful once lint task is passed. This will
make sure the website is not published for arbitrary contributed patches
and is only published for commits pushed/manual job submission.
---
.build.yml | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 .build.yml
diff --git a/.build.yml b/.build.yml
new file mode 100644
index 0000000..b2c00fa
--- /dev/null+++ b/.build.yml
@@ -0,0 +1,27 @@
+image: guix+oauth: builds.sr.ht/JOBS:RW builds.sr.ht/PROFILE:RO+sources:+- https://git.sr.ht/~whereiseveryone/guixrus+packages:+- jq+tasks:+- lint: |+ cd guixrus+ guix lint -L . -n || true+ if [ "$BUILD_REASON" == patchset ]; then+ complete-build # UNDOCUMENTED builds.sr.ht escape hatch+ fi+- publish: |+ curl -s https://git.sr.ht/~whereiseveryone/website/blob/master/.build.yml \+ | jq -sRc --arg jobId "$JOB_ID" --arg jobUrl "$JOB_URL" \+ '{+ "query": "mutation Publish($manifest: String!, $note: String!) { submit(manifest: $manifest, note: $note) { id owner { canonicalName } } }",+ "variables": {+ "manifest": "\(.)",+ "note": "Publish [~whereiseveryone/website](https://git.sr.ht/~whereiseveryone/website) for build [#\($jobId)](\($jobUrl))"+ }+ }' \+ | acurl -s -X POST https://builds.sr.ht/query \+ -H 'Content-Type: application/json' \+ -d @- \+ | jq -r '"Publishing: https://builds.sr.ht/\(.data.submit.owner.canonicalName)/job/\(.data.submit.id)"'
--
2.34.1