-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.52 KB
/
release.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
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Read latest tag
id: read_tag
run: |
TAG=$(git describe --tags --abbrev=0)
echo "Latest tag: $TAG"
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Update version in pyproject.toml
env:
TAG: ${{ steps.read_tag.outputs.TAG }}
run: |
sed -i "s/^version = .*/version = \"$TAG\"/" pyproject.toml
cat pyproject.toml
- name: Update README.md - Github Action version
env:
TAG: ${{ steps.read_tag.outputs.TAG }}
run: |
sed -i "s/kvankova\/code-embedder@.*/kvankova\/code-embedder@$TAG/" README.md
cat README.md
- name: Update README.md - Pre-commit version
env:
TAG: ${{ steps.read_tag.outputs.TAG }}
run: |
sed -i "s/code-embedder==.*/code-embedder==$TAG/" README.md
sed -i "s/rev: v[0-9]\+\.[0-9]\+\.[0-9]\+/rev: $TAG/" README.md
cat README.md
- name: Commit and push changes
env:
TAG: ${{ steps.read_tag.outputs.TAG }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git checkout main
git add pyproject.toml README.md
git commit -m "Bump version to $TAG"
git push origin main