-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 1011 Bytes
/
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
name: Create Release on Tagged Commit
on:
push:
branches:
- main
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get tag for current commit
id: get_tag
run: |
tag=$(git tag --points-at $GITHUB_SHA)
# Remove 'v' prefix if it exists for cleaner handling
version=${tag#v}
echo "tag=$tag" >> $GITHUB_OUTPUT
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create release
if: ${{ steps.get_tag.outputs.tag }}
uses: actions/create-release@v1
with:
tag_name: ${{ steps.get_tag.outputs.tag }}
release_name: ${{ steps.get_tag.outputs.tag }}
body: |
[![npm](https://img.shields.io/badge/npm-v${{ steps.get_tag.outputs.version }}-blue.svg)](https://www.npmjs.com/package/use-m/v/${{ steps.get_tag.outputs.version }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}