-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1.08 KB
/
release.yml
File metadata and controls
42 lines (36 loc) · 1.08 KB
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
name: Release
on:
push:
branches: [main, dev, "feat/**"]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
run: uv sync --dev
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH="${{ github.ref_name }}"
if [[ "$BRANCH" == feat/* ]]; then
# Avoid tag collisions between feat branches (e.g. v1.2.0-alpha.1+feat-my-feature)
uv run semantic-release version --push --vcs-release --build-metadata "${BRANCH//\//-}"
else
uv run semantic-release version --push --vcs-release
fi