|
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | 6 | version: |
7 | | - description: "The type of version bump. Use `-s` for no change. See docs for details: https://python-poetry.org/docs/cli/#version" |
| 7 | + description: "The type of version bump. Use `-s` for no change. See docs for details: https://hatch.pypa.io/latest/version/#supported-segments" |
8 | 8 | type: choice |
9 | 9 | required: true |
10 | 10 | default: "-s" |
11 | 11 | options: |
12 | 12 | - major |
13 | 13 | - minor |
14 | 14 | - patch |
15 | | - - premajor |
16 | | - - preminor |
17 | | - - prepatch |
18 | | - - prerelease |
19 | | - - prerelease --next-phase |
20 | 15 | - "-s" |
| 16 | + prerelease: |
| 17 | + description: "If this is a prerelease and which type. See docs for details: https://hatch.pypa.io/latest/version/#supported-segments" |
| 18 | + type: choice |
| 19 | + required: false |
| 20 | + options: |
| 21 | + - "alpha" |
| 22 | + - "beta" |
| 23 | + - "rc" |
21 | 24 |
|
22 | 25 | jobs: |
23 | 26 | prepare: |
24 | 27 | if: github.repository_owner == 'viamrobotics' |
25 | 28 | runs-on: ubuntu-latest |
26 | 29 | outputs: |
27 | | - version: ${{ steps.bump_version.outputs.version }} |
| 30 | + version: ${{ steps.set_version.outputs.version }} |
28 | 31 | steps: |
29 | 32 | - name: Checkout Code |
30 | 33 | uses: actions/checkout@v4 |
31 | 34 |
|
32 | | - - name: Install Poetry |
33 | | - run: pipx install poetry |
| 35 | + - name: Install uv |
| 36 | + uses: astral-sh/setup-uv@v3 |
34 | 37 |
|
35 | 38 | - name: Setup Python |
36 | | - uses: actions/setup-python@v5 |
37 | | - with: |
38 | | - python-version: "3.12" |
39 | | - cache: poetry |
| 39 | + run: uv python install 3.12 |
40 | 40 |
|
41 | 41 | - name: Install Package |
42 | | - run: poetry install --all-extras |
| 42 | + run: uv sync --all-extras |
43 | 43 |
|
44 | 44 | - name: Clean Format Test |
45 | | - run: make clean format typecheck test |
| 45 | + run: uv run make clean format typecheck test |
| 46 | + |
| 47 | + - name: Bump Version |
| 48 | + id: bump_version |
| 49 | + shell: bash |
| 50 | + if: inputs.version != '-s' && inputs.prerelease |
| 51 | + run: echo "ABC" && uvx hatch version ${{ inputs.version }},${{ inputs.prerelease }} |
46 | 52 |
|
47 | 53 | - name: Bump Version |
48 | 54 | id: bump_version |
49 | 55 | shell: bash |
| 56 | + if: inputs.version != '-s' && !inputs.prerelease |
| 57 | + run: echo "DEF" && uvx hatch version ${{ inputs.version }} |
| 58 | + |
| 59 | + - name: Set Version |
| 60 | + id: set_version |
50 | 61 | run: | |
51 | | - poetry version ${{ inputs.version }} |
52 | | - echo "SDK_VERSION=$(poetry version -s)" >> $GITHUB_ENV |
53 | | - echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT |
| 62 | + echo "SDK_VERSION=$(uvx hatch version)" >> $GITHUB_ENV |
| 63 | + echo "version=$(uvx hatch version)" >> $GITHUB_OUTPUT |
54 | 64 |
|
55 | 65 | - name: Check if release exists |
56 | 66 | uses: cardinalby/[email protected] |
|
0 commit comments