File: Taskfile.yml

package info (click to toggle)
python-odmantic 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,488 kB
  • sloc: python: 8,646; sh: 110; javascript: 45; makefile: 34; xml: 13
file content (46 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download
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
version: "3"

silent: false

vars:
  VERSION_FILE: ./__version__.txt
  RELEASE_NOTE_FILE: ./__release_notes__.md
  RELEASE_BRANCH: "master"
  CURRENT_BRANCH:
    sh: git rev-parse --symbolic-full-name --abbrev-ref HEAD
  RELEASE_COMMIT_FILES: "pyproject.toml uv.lock CHANGELOG.md"

tasks:
  default:
    preconditions:
      - sh: which gh
        msg: gh not found
      - sh: "[ {{.CURRENT_BRANCH}} = {{.RELEASE_BRANCH}} ]"
        msg: "Please switch to {{.RELEASE_BRANCH}} to create a release"
    cmds:
      - task: prepare-workspace
      - task: publish-release
      - task: clean

  prepare-workspace:
    cmds:
      - uv run .github/release.py
  publish-release:
    vars:
      RELEASE_NOTE:
        sh: cat {{.RELEASE_NOTE_FILE}}
      NEW_VERSION:
        sh: cat {{.VERSION_FILE}}
    cmds:
      - uv lock
      - git add {{.RELEASE_COMMIT_FILES}}
      - git commit -m "Release {{.NEW_VERSION}} 🚀"
      - git push
      - git tag v{{.NEW_VERSION}}
      - git push --tags
      - gh release create -d --target {{.RELEASE_BRANCH}} --title v{{.NEW_VERSION}} --notes-file {{.RELEASE_NOTE_FILE}} v{{.NEW_VERSION}}

  clean:
    cmds:
      - rm -f {{.VERSION_FILE}}
      - rm -f {{.RELEASE_NOTE_FILE}}