sonr/Taskfile.yml

77 lines
2.1 KiB
YAML

version: "3"
vars:
VERSION:
sh: git describe --tags --abbrev=0
COMMIT:
sh: git rev-parse --short HEAD
ROOT:
sh: git rev-parse --show-toplevel
OS:
sh: uname -s
TASKS:
sh: task -l
DOPPLER_TOKEN:
sh: skate get DOPPLER_NETWORK
includes:
deps: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/deps.yml
gen: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/gen.yml
hway: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/hway.yml
ipfs: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/ipfs.yml
issue: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/ghpm.yml
procs: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/procs.yml
postgres: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/postgres.yml
sonrd: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/sonrd.yml
tasks:
default:
cmds:
- gh run ls -L 3
- gum format -- "# Sonr ({{.OS}}-{{.VERSION}})" " - ({{.COMMIT}}) {{.ROOT}}"
- task -l -j | jq -r '.tasks[].name' | fzf --height=16 | xargs task
silent: true
start:
desc: Start the Network
silent: true
cmds:
- task: postgres:reset
- task: ipfs:init
- task: ipfs:mount
- task: sonrd:install
- task: hway:build
- task: procs:up
status:
desc: Check the status of the Network
silent: true
cmds:
- task: procs:attach
stop:
desc: Stop the Network
silent: true
cmds:
- task: procs:down
date:
desc: Returns date in YEAR.WEEK.DAY format
cmds:
- |
YEAR=$(date +%Y)
WEEK=$(date +%V)
DAY=$(date +%u)
echo "${YEAR}.${WEEK}.${DAY}"
vars:
DATE: '{{default "" .CLI_ARGS}}'
silent: true
release:
desc: Create a new release with formatted date
cmds:
- curl -sfL https://goreleaser.com/static/run | DISTRIBUTION=pro VERSION=v{{.VERSION}} bash -s -- check
- RELEASE_DATE=$(task date) goreleaser release --clean
silent: true