File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 55 branches : [ master ]
66
77jobs :
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 :
3577
3678 npm-package-release :
3779 runs-on : ubuntu-latest
80+ needs : create-tag
3881 if : github.ref == 'refs/heads/master'
3982
4083 steps :
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments