-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.16 KB
/
main.yml
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
name: Tag
on:
push:
branches:
- main
permissions:
contents: "write"
id-token: "write"
jobs:
test:
name: Test and tag
runs-on:
group: "Cabana-CICD"
steps:
- uses: actions/checkout@v4
with:
submodules: true # Optional, use if you have submodules
- uses: FedericoCarboni/setup-ffmpeg@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Test with tox
run: |
poetry install --no-interaction
poetry run tox
- name: The new tag
id: computed-tag
run: |
set -e
TAG=$(cat pyproject.toml \
| grep --extended-regexp "^version =" \
| grep --extended-regexp --only-matching "[0-9]+\.[0-9]+.[0-9]+[-\.\+a-zA-Z0-9]*" \
| head --lines=1)
echo "tag=v$TAG" >> "$GITHUB_OUTPUT"
- name: Tag main depending on the value in pyproject.toml
uses: djordon/[email protected]
with:
tag: ${{ steps.computed-tag.outputs.tag }}