-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (37 loc) · 1 KB
/
release-tag.yaml
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
# SPDX-FileCopyrightText: 2023-2024 Steffen Vogel <[email protected]>
# SPDX-License-Identifier: Apache-2.0
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json
---
name: Tag Semver
on:
push:
branches:
- main
jobs:
semver-tag:
name: Add a Semantic Versioned Tag
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- name: Setup svu
run: |
go install github.com/caarlos0/svu@latest
- name: Create new tag
run: |
CURRENT=$(svu current)
NEXT=$(svu next)
if [ ${CURRENT} != ${NEXT} ]; then
git tag ${NEXT}
git push origin tag ${NEXT}
echo "Tagged new release with ${NEXT}"
else
echo "No new commits to tag"
fi