-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.12 KB
/
tag_adapters.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Tag adapters
on:
push:
branches:
- main
permissions:
contents: write
env:
GIT_USER_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_USER_NAME: ${{ secrets.GIT_NAME }}
jobs:
tag_adapter:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
name: Tag adapter
runs-on: ubuntu-latest
strategy:
matrix:
adapter:
- slog
- zerolog
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
ref: "main"
- name: Fetch tags for adapter
run: git fetch --tags origin '+refs/tags/adapters/${{ matrix.adapter }}/*:refs/tags/adapters/${{ matrix.adapter }}/*'
- name: Files modified
id: check
uses: tj-actions/[email protected]
with:
files: |
./adapters/${{ matrix.adapter }}/*
- name: Config Git User
if: steps.check.outputs.any_changed == 'true'
run: |
git config --local user.email "$GIT_USER_EMAIL"
git config --local user.name "$GIT_USER_NAME"
git config --local pull.ff only
- name: Setup Python
if: steps.check.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install commitizen
if: steps.check.outputs.any_changed == 'true'
run: pip install -U commitizen
- id: cz
name: Create bump and changelog
if: steps.check.outputs.any_changed == 'true'
working-directory: adapters/${{ matrix.adapter }}
run: |
python -m pip install -U commitizen
cz bump --changelog --yes
export REV=`cz version --project`
echo "version=$REV" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.check.outputs.any_changed == 'true'
uses: Woile/github-push-action@master
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
tags: "true"
branch: "main"
- name: Print Version
if: steps.check.outputs.any_changed == 'true'
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"