Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,50 @@ on:
branches: [ master ]

jobs:
create-tag:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
outputs:
version: ${{ steps.get-version.outputs.version }}
tag-created: ${{ steps.create-tag.outputs.tag-created }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get package version
id: get-version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=v$VERSION" >> $GITHUB_OUTPUT
echo "Package version: v$VERSION"

- name: Check if tag exists
id: check-tag
run: |
if git tag -l "${{ steps.get-version.outputs.version }}" | grep -q "${{ steps.get-version.outputs.version }}"; then
echo "tag-exists=true" >> $GITHUB_OUTPUT
echo "Tag ${{ steps.get-version.outputs.version }} already exists"
else
echo "tag-exists=false" >> $GITHUB_OUTPUT
echo "Tag ${{ steps.get-version.outputs.version }} does not exist"
fi

- name: Create and push tag
id: create-tag
if: steps.check-tag.outputs.tag-exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "${{ steps.get-version.outputs.version }}" -m "Release ${{ steps.get-version.outputs.version }}"
git push origin "${{ steps.get-version.outputs.version }}"
echo "tag-created=true" >> $GITHUB_OUTPUT
echo "Created and pushed tag: ${{ steps.get-version.outputs.version }}"

github-package-release:
runs-on: ubuntu-latest
needs: create-tag
if: github.ref == 'refs/heads/master'

steps:
Expand Down Expand Up @@ -35,6 +77,7 @@ jobs:

npm-package-release:
runs-on: ubuntu-latest
needs: create-tag
if: github.ref == 'refs/heads/master'

steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ateliee/jq.schedule",
"version": "4.0.2",
"version": "4.0.3",
"description": "jQuery time schedule plugin",
"main": "src/js/jq.schedule.js",
"types": "src/@types/jq.schedule.d.ts",
Expand Down
Loading