CI: build-only validation (no make/python/contexts); commit folded erudit.txt
build / dawg (pull_request) Successful in 1m11s
build / dawg (pull_request) Successful in 1m11s
- build.yaml dropped the release step whose ${{ github.* }} contexts failed the Gitea
workflow compile (the run produced 0 jobs); it now inlines go run (no make dependency)
and reads the committed dictprep/russian/erudit.txt (no python dependency).
- erudit.txt is scrabble.txt with Ё→Е folded (dictprep/fold_yo.py); it reproduces the
canonical ru_erudit.dawg byte-for-byte. Release artifacts are published manually for now
(see README).
This commit is contained in:
+10
-29
@@ -1,14 +1,15 @@
|
||||
name: build
|
||||
|
||||
# Builds the dictionary DAWGs on every push/PR (validation) and, on a vX.Y.Z tag,
|
||||
# packages them flat into scrabble-dawg-<tag>.tar.gz and attaches it to the Gitea release.
|
||||
# The build pins the published scrabble-solver builders (GOPRIVATE -> direct VCS fetch from
|
||||
# this Gitea), so the on-disk format matches the running backend exactly.
|
||||
# Validation gate: rebuilds the three dictionary DAWGs on every push/PR and checks they are
|
||||
# non-empty. The build pins the published scrabble-solver builders (GOPRIVATE -> direct VCS
|
||||
# fetch from this Gitea), so the on-disk format and letter indexing match the running backend
|
||||
# exactly. Release artifacts (scrabble-dawg-<tag>.tar.gz attached to the Gitea release) are
|
||||
# published from this output; see README.md. Inlined go run (no make/python dependency on the
|
||||
# runner).
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
@@ -32,31 +33,11 @@ jobs:
|
||||
|
||||
- name: Build DAWGs
|
||||
run: |
|
||||
make dawg
|
||||
mkdir -p dawg
|
||||
go run ./cmd/builddict -dict dictionaries/english/sowpods.txt -alphabet latin -name en_sowpods -out dawg
|
||||
go run ./cmd/builddict -dict dictprep/russian/scrabble.txt -alphabet russian -name ru_scrabble -out dawg
|
||||
go run ./cmd/builddict -dict dictprep/russian/erudit.txt -alphabet russian -name ru_erudit -out dawg
|
||||
ls -la dawg/
|
||||
for f in en_sowpods ru_scrabble ru_erudit; do
|
||||
test -s "dawg/$f.dawg" || { echo "missing dawg/$f.dawg"; exit 1; }
|
||||
done
|
||||
|
||||
- name: Package and publish release artifact
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
TOKEN: ${{ github.token }}
|
||||
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
|
||||
run: |
|
||||
set -eo pipefail
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
art="scrabble-dawg-${tag}.tar.gz"
|
||||
tar czf "$art" -C dawg en_sowpods.dawg ru_scrabble.dawg ru_erudit.dawg
|
||||
# Create the release (or fetch it if it already exists), then upload the asset.
|
||||
code=$(curl -sS -o /tmp/rel.json -w '%{http_code}' -X POST "$API/releases" \
|
||||
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||
-d "{\"tag_name\":\"$tag\",\"name\":\"$tag\",\"body\":\"Dictionary DAWG set $tag (en_sowpods, ru_scrabble, ru_erudit).\"}")
|
||||
if [ "$code" != "201" ]; then
|
||||
echo "release POST returned $code; fetching existing release for tag $tag"
|
||||
curl -sS -o /tmp/rel.json "$API/releases/tags/$tag" -H "Authorization: token $TOKEN"
|
||||
fi
|
||||
rel_id=$(python3 -c 'import json;print(json.load(open("/tmp/rel.json"))["id"])')
|
||||
curl -sS -X POST "$API/releases/$rel_id/assets?name=$art" \
|
||||
-H "Authorization: token $TOKEN" -F "attachment=@$art" -o /tmp/asset.json
|
||||
echo "published $art to release $rel_id"
|
||||
|
||||
Reference in New Issue
Block a user