first commit
This commit is contained in:
73
development/manage-version.yaml
Normal file
73
development/manage-version.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
# yaml-language-server: $schema=https://git.jesof.ch/public/mstr-schemas/raw/branch/main/mstr-tasks-schema.json
|
||||
|
||||
tasks:
|
||||
- execute:
|
||||
description: "Git Hash"
|
||||
exec: "git"
|
||||
dir: "."
|
||||
args:
|
||||
- "rev-parse"
|
||||
- "HEAD"
|
||||
parsers:
|
||||
- name: "Parse Text"
|
||||
expression: "(.*)"
|
||||
parser: "regexp"
|
||||
variables:
|
||||
- "githash"
|
||||
|
||||
- loadVersion:
|
||||
description: "Load version file and increment release level"
|
||||
varName: "version"
|
||||
file: ".mstr.json"
|
||||
increment: $(release)
|
||||
|
||||
- saveVersion:
|
||||
description: "Save version file"
|
||||
varName: "version"
|
||||
file: ".mstr.json"
|
||||
|
||||
- execute:
|
||||
description: "Git Add Changes"
|
||||
exec: "git"
|
||||
dir: "."
|
||||
args:
|
||||
- "add"
|
||||
- ".mstr.json"
|
||||
|
||||
- execute:
|
||||
description: "Git Commit Changes"
|
||||
exec: "git"
|
||||
dir: "."
|
||||
args:
|
||||
- "commit"
|
||||
- "-m"
|
||||
- "Version file updated"
|
||||
|
||||
- execute:
|
||||
description: "Git Push Changes"
|
||||
exec: "git"
|
||||
dir: "."
|
||||
args:
|
||||
- "push"
|
||||
- "--all"
|
||||
|
||||
- execute:
|
||||
description: "Release Version"
|
||||
exec: "curl"
|
||||
args:
|
||||
- "-sS"
|
||||
- "-X"
|
||||
- "POST"
|
||||
- "-H"
|
||||
- "Authorization: token $(decrypt(gitToken,keyfile))"
|
||||
- "-H"
|
||||
- "Content-Type: application/json"
|
||||
- "@(git)/api/v1/repos/golang/$(gitRepo)/releases"
|
||||
- "-d"
|
||||
- '{"tag_name": "$(version)","name": "$(version)","body": "## Changes\n- Release via API","draft": false,"prerelease": false}'
|
||||
parsers:
|
||||
- name: "Get release ID"
|
||||
parser: "jq"
|
||||
expression: ".id"
|
||||
variables:
|
||||
- "releaseId"
|
||||
Reference in New Issue
Block a user