Skip to content

Commit 32e7839

Browse files
committed
Make: Automate versioning in CI
1 parent 7420d05 commit 32e7839

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
env:
8+
BUILD_TYPE: Release
9+
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
10+
PYTHONUTF8: 1
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: write
15+
pages: write
16+
id-token: write
17+
packages: write
18+
19+
jobs:
20+
versioning:
21+
name: Update Version
22+
runs-on: ubuntu-24.04
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v5
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
- name: Run TinySemVer
30+
uses: ashvardanian/[email protected]
31+
with:
32+
verbose: "true"
33+
version-file: "VERSION"
34+
update-version-in: |
35+
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
36+
pyproject.toml:^version = "(\d+\.\d+\.\d+)"
37+
dry-run: "false"
38+
push: "true"
39+
create-release: "true"
40+
github-token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
41+
42+
rebase:
43+
name: Rebase Dev. Branch
44+
runs-on: ubuntu-24.04
45+
if: github.ref == 'refs/heads/main'
46+
needs: versioning
47+
steps:
48+
- name: Checkout the latest code
49+
uses: actions/checkout@v5
50+
with:
51+
fetch-depth: 0
52+
submodules: recursive
53+
54+
- name: Perform rebase
55+
run: |
56+
git fetch origin main
57+
git checkout main-dev
58+
git rebase origin/main
59+
60+
- name: Push changes
61+
uses: CasperWA/push-protected@v2
62+
with:
63+
token: ${{ secrets.SEMANTIC_REBASE_TOKEN }}
64+
branch: main-dev
65+
unprotect_reviews: True
66+
force: True

0 commit comments

Comments
 (0)