-
Notifications
You must be signed in to change notification settings - Fork 423
37 lines (33 loc) · 956 Bytes
/
tag-pkg.yml
File metadata and controls
37 lines (33 loc) · 956 Bytes
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
name: Tag pkg
on:
workflow_dispatch:
inputs:
version:
description: "pkg version to tag (e.g. v1.2.2)"
required: true
type: string
permissions:
contents: write
jobs:
tag:
name: Create pkg tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: develop
fetch-depth: 0
- name: Create and push pkg tag
run: |
VERSION="${{ inputs.version }}"
if ! [[ "$VERSION" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
echo "Error: version '$VERSION' does not match semver format (e.g. v1.2.2)"
exit 1
fi
TAG="pkg/$VERSION"
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Error: tag '$TAG' already exists"
exit 1
fi
git tag "$TAG"
git push origin "$TAG"