yabs.yaml#
The following file lists all available tasks with all available options and respective defaults.
Note
This is not a meaningful or realistic workflow definition, but rather
a demonstration of what’s available.
A realistic workflow would omit default options and execute tasks in a
more useful order.
See Writing Scripts for an example.
Annotated Sample Configuration#
1# Release-Tool Workflow Definition
2# See https://github.com/mar10/yabs
3file_version: yabs#1
4config:
5 # Options used as default for all tools in this workflow
6 repo: 'mar10/test-release-tool'
7 # GitHub access token
8 gh_auth:
9 oauth_token_var: GITHUB_OAUTH_TOKEN
10 version:
11 - type: __version__ # First entry is master for synchronizing
12 file: src/test_release_tool/__init__.py
13 # match: '__version__\s*=\s*[''\"](\d+\.\d+\.\d+).*[''\"]'
14 # template: '__version__ = "{version}"'
15 # - type: setup_cfg # First entry is master for synchronizing
16 # entry: metadata.version
17 # template:
18 max_increment: minor
19 branches: # Allowed git branches
20 - main # Used by GitHub since 2020-11
21 - master # legacy
22
23
24tasks:
25 # The following tools are available. They are executed in the order
26 # listed here
27
28 # 'check': Assert preconditons and fail otherwise
29 - task: check
30 build: true # dist/ folder exists
31 can_push: true # Test if 'git push' would/would not succeed
32 github: true # GitHub repo name valid and online accessible
33 clean: true # Repo must/must not contain modifications
34 os: null # (str, list)
35 python: ">=3.9" # SemVer specifier
36 twine: true # `twine` is available
37 up_to_date: true # everything pulled from remote
38 venv: true # running inside a virtual environment
39 version: true # `setup.py --version` returns the configured version
40 # winget: true # `wingetcreate` is available
41 yabs: ">=0.5" # SemVer specifier
42
43 # 'run': Run arbitrary shell command
44 - task: exec
45 args: ["tox", "-e", "lint"] # shell command and optional arguments
46 # dry_run_args: ["pwd"] #
47 always: true # `true`: run even in dry-run mode
48 silent: true # `true`: suppress output
49 ignore_errors: false # `true`: show warning, but proceed on errors (exit code != 0)
50
51 - task: exec
52 args: ["tox"] # shell command and optional arguments
53 # dry_run_args: ["pwd"] #
54 always: true # `true`: run even in dry-run mode
55 silent: true # `true`: suppress output
56 ignore_errors: false # `true`: show warning, but proceed on errors (exit code != 0)
57
58 # 'bump': Increment project version (requires argument: `yabs run --inc INC`)
59 - task: bump
60 inc: null # Use value passed as 'yabs run --inc INC'
61
62 # # 'replace': In-place string replacements
63 # # (Uses https://github.com/outaTiME/applause)
64 # - task: replace
65 # files: null # minimatch globbing pattern
66 # patterns: [] # See https://github.com/outaTiME/applause
67 # # Shortcut patterns (pass false to disable):
68 # setTimestamp: "{%= grunt.template.today('isoUtcDateTime') %}"
69 # # Replace '@@timestamp' with current datetime
70 # setVersion: '{version}' # Replace '@@version' with current version
71
72 # 'commit': Commit modified files
73 - task: commit
74 add: [] # Also `git add` these files ('.' for all)
75 add_known: true # Commit with -a flag
76 message: |
77 Bump version to {version}
78
79 # 'tag': Create an annotated tag
80 - task: tag #
81 name: v{version} #
82 message: | #
83 Version {version}
84
85 # 'push': Push changes and tags
86 - task: push
87 tags: true # Use `--follow-tags`
88
89 # 'pypi_release': Create a release on PyPI
90 - task: pypi_release
91 build:
92 - sdist
93 - bdist_wheel
94 upload: true
95 # revert_bump_on_error: true
96
97 # 'github_release': Create a release on GitHub
98 - task: github_release
99 # Override `config.gh_gh_auth`:
100 gh_auth: null
101 name: 'v{version}'
102 message: |
103 Released {version}
104
105 [Changelog](https://github.com/{repo}/blob/master/CHANGELOG.md),
106 [Commit details](https://github.com/{repo}/compare/{org_tag_name}...{tag_name}).
107 # draft: true
108 prerelease: null # null: guess from version number format
109 upload:
110 - sdist
111 - bdist_wheel
112
113 # Windows Packager Manager release
114 - task: winget_release
115 upload: bdist_msi
116 package_id: 'USER.PROJECT'
117 assume_synced: false # If True, skip warning about outdated fork
118
119 - task: bump
120 inc: "postrelease"
121
122 - task: commit
123 add_known: true
124 message: |
125 Bump prerelease ({version}) [ci skip]
126
127 - task: push