📕 yarn is a Self-Hosted, Twitter™-like Decentralised Microblogging platform. No ads, no tracking, your content, your data! https://yarn.social/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

94 lines
2.3 KiB

# https://taskfile.dev
version: '3'
output: 'prefixed'
vars:
YarnSvc: yard
YarnExe: yard{{exeExt}}
tasks:
default:
cmds:
- task -l
silent: true
yard:
desc: run yard service
cmds:
- task: run-yard
build-yard:
desc: build yard service
deps: [yard-css, yard-js, tr-merge]
cmds:
- echo "{{.YarnExe}} building..."
- go build -v -o {{.YarnExe}} -ldflags "-w -X {{.Module}}.Version={{.Version}} -X {{.Module}}.Commit={{.Commit}}" cmd/{{.YarnSvc}}/main.go
- echo "{{.YarnExe}} built."
generates:
- '{{.YarnExe}}'
sources:
- '**/*.go'
method: none
vars:
Commit:
sh: git rev-parse --short HEAD
Version:
sh: git describe --abbrev=0
Module:
sh: go list
silent: false
run-yard:
cmds:
- ./yard --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --debug --base-url http://localhost:8000 --bind 127.0.0.1:8000 --twts-per-page 5 --name twtxt.cc
deps: [build-yard]
desc: run yard service
silent: false
yard-css:
cmds:
- minify -b -o ./internal/static/css/twtxt.min.css ./internal/static/css/[0-9]*-*.css
sources:
- internal/css/**/*.css
generates:
- internal/static/css/twtxt.min.css
yard-js:
cmds:
- minify -b -o ./internal/static/js/twtxt.min.js ./internal/static/js/[0-9]*-*.js
sources:
- internal/js/**/*.js
generates:
- internal/static/js/twtxt.min.js
tr:
dir: internal/langs
cmds:
- goi18n merge active.*.toml
desc: goi18n create
tr-merge:
dir: internal/langs
cmds:
- goi18n merge active.*.toml translate.*.toml
desc: goi18n merge
release:
desc: release
deps: [build-yard]
cmds:
# - mkdir -pv ./release/internal/{static,langs}
- mkdir -pv ./release/internal/static/{css,js}
- cp -Rpfv ./{{.YarnExe}} ./release/
- cp -Rpfv ./internal/static/css/twtxt.min.css ./release/internal/static/css/
- cp -Rpfv ./internal/static/js/twtxt.min.js ./release/internal/static/js/
# - cp -Rpfv ./internal/langs/active.*.toml ./release/internal/langs/
- ./release/{{.YarnExe}} --cookie-secret abc --magiclink-secret abc --api-signing-key abc -R --base-url http://localhost:8000 --bind 127.0.0.1:8000 --name twtxt.cc
clean:
desc: clean
cmds:
- rm -rf ./release