-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.15 KB
/
release.yml
File metadata and controls
44 lines (37 loc) · 1.15 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
43
44
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Tag version (e.g. v1.0.0)"
required: true
type: string
latest:
description: "Update moving tag (e.g. v1)"
required: false
default: "true"
type: boolean
permissions: write-all
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Create tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
if [ "${{ github.event.inputs.latest }}" = "true" ]; then
MAJOR=$(echo "${{ github.event.inputs.version }}" | grep -oP '^v[0-9]+')
git tag -f $MAJOR
git push origin -f $MAJOR
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.version }}
generate_release_notes: true