chore: versioning

This commit is contained in:
2026-05-26 17:10:26 +02:00
parent 51d738a442
commit 0fd3a41f1c
5 changed files with 114 additions and 71 deletions
+6 -48
View File
@@ -6,6 +6,10 @@ on:
permissions:
contents: write
env:
VERSION_MAJOR: '1'
VERSION_MINOR: '1'
jobs:
build:
runs-on: ubuntu-latest
@@ -17,10 +21,10 @@ jobs:
fetch-depth: 0
fetch-tags: true
- name: Use NodeJS v24.14.0
- name: Use NodeJS v22.22.3
uses: actions/setup-node@v6
with:
node-version: '24.14.0'
node-version: '22.22.3'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
@@ -39,49 +43,3 @@ jobs:
- name: Run Build
run: npm run build
- name: Publish Library
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: v${{ steps.release_version.outputs.tag }}
run: |
git fetch --force --tags
previous_tag="$(gh api repos/${{ github.repository }}/releases --paginate --jq '.[] | select(.draft == false) | .tag_name' | grep -Fxv "$RELEASE_TAG" | head -n 1 || true)"
if [ -n "$previous_tag" ]; then
if git rev-parse --verify --quiet "${previous_tag}^{commit}" >/dev/null; then
commit_messages="$(git log --reverse --format='- %s' "${previous_tag}..${GITHUB_SHA}")"
else
commit_messages="$(git log --reverse --format='- %s' "${GITHUB_SHA}")"
fi
full_changelog="https://github.com/${{ github.repository }}/compare/${previous_tag}...${RELEASE_TAG}"
else
commit_messages="$(git log --reverse --format='- %s' "${GITHUB_SHA}")"
full_changelog=""
fi
if [ -z "$commit_messages" ]; then
commit_messages='- No commits since the previous release'
fi
{
echo '## Changes'
echo
printf '%s\n' "$commit_messages"
echo
if [ -n "$full_changelog" ]; then
echo "**Full Changelog**: ${full_changelog}"
fi
} > release-notes.md
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release edit "$RELEASE_TAG" --title "$RELEASE_TAG" --notes-file release-notes.md
else
gh release create "$RELEASE_TAG" --target "${GITHUB_SHA}" --title "$RELEASE_TAG" --notes-file release-notes.md
fi