Skip to content

Commit b340ed9

Browse files
authored
Merge pull request #68 from ateliee/devin/1750398905-version-update-and-tagging
chore: update version to 4.0.3 and create tag
2 parents 6dd4ab3 + 37d6358 commit b340ed9

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,50 @@ on:
55
branches: [ master ]
66

77
jobs:
8+
create-tag:
9+
runs-on: ubuntu-latest
10+
if: github.ref == 'refs/heads/master'
11+
outputs:
12+
version: ${{ steps.get-version.outputs.version }}
13+
tag-created: ${{ steps.create-tag.outputs.tag-created }}
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get package version
21+
id: get-version
22+
run: |
23+
VERSION=$(node -p "require('./package.json').version")
24+
echo "version=v$VERSION" >> $GITHUB_OUTPUT
25+
echo "Package version: v$VERSION"
26+
27+
- name: Check if tag exists
28+
id: check-tag
29+
run: |
30+
if git tag -l "${{ steps.get-version.outputs.version }}" | grep -q "${{ steps.get-version.outputs.version }}"; then
31+
echo "tag-exists=true" >> $GITHUB_OUTPUT
32+
echo "Tag ${{ steps.get-version.outputs.version }} already exists"
33+
else
34+
echo "tag-exists=false" >> $GITHUB_OUTPUT
35+
echo "Tag ${{ steps.get-version.outputs.version }} does not exist"
36+
fi
37+
38+
- name: Create and push tag
39+
id: create-tag
40+
if: steps.check-tag.outputs.tag-exists == 'false'
41+
run: |
42+
git config user.name "github-actions[bot]"
43+
git config user.email "github-actions[bot]@users.noreply.github.com"
44+
git tag -a "${{ steps.get-version.outputs.version }}" -m "Release ${{ steps.get-version.outputs.version }}"
45+
git push origin "${{ steps.get-version.outputs.version }}"
46+
echo "tag-created=true" >> $GITHUB_OUTPUT
47+
echo "Created and pushed tag: ${{ steps.get-version.outputs.version }}"
48+
849
github-package-release:
950
runs-on: ubuntu-latest
51+
needs: create-tag
1052
if: github.ref == 'refs/heads/master'
1153

1254
steps:
@@ -35,6 +77,7 @@ jobs:
3577

3678
npm-package-release:
3779
runs-on: ubuntu-latest
80+
needs: create-tag
3881
if: github.ref == 'refs/heads/master'
3982

4083
steps:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ateliee/jq.schedule",
3-
"version": "4.0.2",
3+
"version": "4.0.3",
44
"description": "jQuery time schedule plugin",
55
"main": "src/js/jq.schedule.js",
66
"types": "src/@types/jq.schedule.d.ts",

0 commit comments

Comments
 (0)