-
-
Notifications
You must be signed in to change notification settings - Fork 663
50 lines (43 loc) · 1.5 KB
/
auto-tag.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Auto Tag Release on Version Change
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "deno.json"
jobs:
auto-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.CR_PAT }}
- name: Get version from deno.json
id: get_version
run: |
VERSION=$(jq -r .version deno.json)
if ! git ls-remote --tags origin | grep -q "refs/tags/v${VERSION}"; then
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version found: $VERSION"
else
echo "Version already exists: $VERSION"
fi
- name: Create Git Tag
if: steps.get_version.outputs.version != ''
run: |
git tag v${{ steps.get_version.outputs.version }}
git push origin v${{ steps.get_version.outputs.version }}
- name: Create GitHub Release
if: steps.get_version.outputs.version != ''
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}
name: Release v${{ steps.get_version.outputs.version }}
body: |
🤖 GitHub App: [Pull](https://github.com/apps/pull)
draft: false
prerelease: ${{ contains(steps.get_version.outputs.version, 'alpha') || contains(steps.get_version.outputs.version, 'beta') || contains(steps.get_version.outputs.version, 'rc') }}