-
Notifications
You must be signed in to change notification settings - Fork 5
36 lines (34 loc) · 1.18 KB
/
v-tag-to-release.yml
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
on:
push:
tags:
- 'v*' # trigger this when a tag starting with v is pushed
name: Create Release from v-Tag
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: De-v the release tag
id: de_v_tag
run: |
# Use the 'replace' function to remove the "v" from the tag
TAG="${{ github.ref }}"
TAG_WITHOUT_V="${TAG#refs/tags/v}"
echo "Extracted tag: $TAG_WITHOUT_V"
echo "tag_without_v=$TAG_WITHOUT_V" >> "$GITHUB_OUTPUT"
- name: Show the modified tag
run: |
MODIFIED_TAG="${{ steps.de_v_tag.outputs.tag_without_v }}"
echo "Modified tag: Release $MODIFIED_TAG"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.de_v_tag.outputs.tag_without_v }}
release_name: Release ${{ steps.de_v_tag.outputs.tag_without_v }}
draft: false
prerelease: false