Skip to content

Commit 468676d

Browse files
committed
updated file
1 parent c4792eb commit 468676d

2 files changed

Lines changed: 7 additions & 43 deletions

File tree

.github/release.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -61,60 +61,24 @@
6161
# --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
6262
# --generate-notes
6363

64-
name: Auto Tag and Create Release notes
64+
name: Release on Tag
6565

6666
on:
6767
push:
68-
branches:
69-
- main
68+
tags:
69+
- 'v*' # Trigger only on version tags like v1.0.0
7070

7171
permissions:
72-
contents: write
72+
contents: write # Required to create a release
7373

7474
jobs:
75-
tag-and-release:
75+
release:
7676
runs-on: ubuntu-latest
7777
steps:
7878
- name: Checkout code
7979
uses: actions/checkout@v3
8080

81-
- name: Fetch all tags
82-
run: git fetch --tags
83-
84-
- name: Get latest tag
85-
id: get_tag
86-
run: |
87-
latest=$(git tag --sort=-v:refname | head -n 1)
88-
echo "Latest tag: $latest"
89-
if [ -z "$latest" ]; then
90-
echo "tag=v0.0.0" >> $GITHUB_OUTPUT
91-
else
92-
echo "tag=$latest" >> $GITHUB_OUTPUT
93-
fi
94-
95-
- name: Bump patch version
96-
id: bump
97-
run: |
98-
version=${{ steps.get_tag.outputs.tag }}
99-
echo "Current version: $version"
100-
parts=(${version//./ })
101-
major="${parts[0]#v}"
102-
minor="${parts[1]}"
103-
patch="${parts[2]}"
104-
next_patch=$((patch + 1))
105-
new_tag="v$major.$minor.$next_patch"
106-
echo "New tag: $new_tag"
107-
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
108-
109-
- name: Create new tag
110-
run: |
111-
git config user.name "github-actions[bot]"
112-
git config user.email "github-actions[bot]@users.noreply.github.com"
113-
git tag ${{ steps.bump.outputs.new_tag }}
114-
git push origin ${{ steps.bump.outputs.new_tag }}
115-
116-
- name: Create GitHub Release with Notes
81+
- name: Create GitHub Release
11782
uses: softprops/action-gh-release@v1
11883
with:
119-
tag_name: ${{ steps.bump.outputs.new_tag }}
12084
generate_release_notes: true

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
gg
1+
console.log('a simple file');

0 commit comments

Comments
 (0)