chore: updated ci configuration to re-trigger merge from freb97/renov… #60
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' && | |
!contains(github.event.head_commit.message, '/renovate/') && | |
!contains(github.event.head_commit.message, '[skip-release]') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install | |
run: | | |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }} | |
npm install | |
npm run dev:prepare | |
- name: Release | |
run: npm run release:ci | |
bump-version: | |
name: 'Bump package version' | |
needs: [ test ] | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'push' && | |
contains(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 | |
- name: Bump version | |
id: bump_version | |
run: | | |
export GITHUB_TOKEN="${{ secrets.REPOSITORY_ACCESS_TOKEN }}" | |
git config user.name "${{ secrets.CI_AUTHOR }}" | |
git config user.email "${{ secrets.CI_EMAIL }}" | |
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 |