Skip to content

Commit 2eaca01

Browse files
committed
feat(github-actions): add auto tag workflow
1 parent 5b9817f commit 2eaca01

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/auto-tag.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Auto Tag Release on Version Change
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "deno.json"
9+
10+
jobs:
11+
auto-tag:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Get version from deno.json
22+
id: get_version
23+
run: |
24+
VERSION=$(jq -r .version deno.json)
25+
if ! git ls-remote --tags origin | grep -q "refs/tags/v${VERSION}"; then
26+
echo "version=$VERSION" >> $GITHUB_OUTPUT
27+
echo "Version found: $VERSION"
28+
else
29+
echo "Version already exists: $VERSION"
30+
fi
31+
32+
- name: Create Git Tag
33+
if: steps.get_version.outputs.version != ''
34+
run: |
35+
git tag v${{ steps.get_version.outputs.version }}
36+
git push origin v${{ steps.get_version.outputs.version }}
37+
38+
- name: Create GitHub Release
39+
if: steps.get_version.outputs.version != ''
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
tag_name: v${{ steps.get_version.outputs.version }}
43+
name: Release v${{ steps.get_version.outputs.version }}
44+
body: |
45+
🤖 GitHub App: [Pull](https://github.com/apps/pull)
46+
draft: false
47+
prerelease: ${{ contains(steps.get_version.outputs.version, 'alpha') || contains(steps.get_version.outputs.version, 'beta') || contains(steps.get_version.outputs.version, 'rc') }}

.github/workflows/publish.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Create and publish a Docker image
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- "master"

0 commit comments

Comments
 (0)