chore: updated package version #195
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test & Release' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: 'Test package' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install | |
run: | | |
npm install | |
npm run dev:prepare | |
- name: Lint | |
run: | | |
npm run lint:es | |
npm run lint:types | |
- name: Test | |
run: npm run test | |
release: | |
name: 'Release package' | |
needs: [ test ] | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/main' && | |
!contains(github.event.head_commit.message, '[skip-release]') && | |
!startsWith(github.event.head_commit.message, '/renovate/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install | |
run: | | |
npm install | |
npm run dev:prepare | |
- name: Release | |
run: | | |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} | |
npm run release:ci | |
bump-version: | |
name: 'Bump package version' | |
needs: [ test ] | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'push' && | |
startsWith(github.ref, 'refs/heads/renovate/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install | |
run: | | |
npm install | |
npm run dev:prepare | |
- name: Bump version | |
id: bump_version | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
NEW_VERSION=$(npm version patch -m "chore: bumped package version to %s") | |
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
- name: Update CHANGELOG.md | |
run: | | |
echo -e "# $NEW_VERSION\n- Bumped dependencies\n\n$(cat CHANGELOG.md)" > CHANGELOG.md | |
git add CHANGELOG.md | |
- name: Push changes | |
run: | | |
git commit --amend --no-edit | |
git push origin main --tags | |
- name: Release new version | |
run: | | |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} | |
npm run release:ci |