-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
60 lines (46 loc) · 2 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Author: hustcer
# Create: 2024/06/09 18:05:20
# Description:
# Some helper task for milestone-action.
# Ref:
# 1. https://github.com/casey/just
# 2. https://www.nushell.sh/book/
set shell := ['nu', '-c']
# The export setting causes all just variables
# to be exported as environment variables.
set export := true
set dotenv-load := true
# If positional-arguments is true, recipe arguments will be
# passed as positional arguments to commands. For linewise
# recipes, argument $0 will be the name of the recipe.
set positional-arguments := true
# Just commands aliases
alias r := release
# Use `just --evaluate` to show env vars
# Used to handle the path separator issue
NU_DIR := parent_directory(`(which nu).path.0`)
MILESTONE_ACTION_PATH := parent_directory(justfile())
_query_plugin := if os_family() == 'windows' { 'nu_plugin_query.exe' } else { 'nu_plugin_query' }
# To pass arguments to a dependency, put the dependency
# in parentheses along with the arguments, just like:
# default: (sh-cmd "main")
# List available commands by default
default:
@just --list --list-prefix "··· "
# Release a new version for `hustcer/milestone-action`
release *OPTIONS:
@overlay use {{ join(MILESTONE_ACTION_PATH, 'nu', 'common.nu') }}; \
overlay use {{ join(MILESTONE_ACTION_PATH, 'nu', 'release.nu') }}; \
git-check --check-repo=1 {{MILESTONE_ACTION_PATH}}; \
make-release {{OPTIONS}}
# Set milestone to PR in dry-run mode, e.g. `just dr hustcer/milestone-action --pr 36`
dr *OPTIONS:
@overlay use {{ join(MILESTONE_ACTION_PATH, 'nu', 'milestone.nu') }}; \
milestone-action bind-pr {{OPTIONS}} --dry-run
# Set milestone to issue in dry-run mode, e.g. `just di hustcer/milestone-action --issue 20`
di *OPTIONS:
@overlay use {{ join(MILESTONE_ACTION_PATH, 'nu', 'milestone.nu') }}; \
milestone-action bind-issue {{OPTIONS}} --dry-run
# Plugins need to be registered only once after nu v0.61
_setup:
@register -e json {{ join(NU_DIR, _query_plugin) }}