chore(deps): update dependency eslint-plugin-react to v7.37.1 (#166) #159
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: Publishing to npm | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "!*" | |
concurrency: publish-to-npm | |
env: | |
NODE_VERSION: 20.x | |
jobs: | |
check-version: | |
name: Checking wheather it can be published or not | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
outputs: | |
can-publish: ${{ steps.check-status.outputs.can-publish }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setting up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
- name: Executing can-npm-publish | |
id: check-status | |
run: | | |
if npx can-npm-publish --verbose; then | |
echo "can-publish=1" >> "$GITHUB_OUTPUT" | |
else | |
echo "Publishing to npm will be skipped" | |
echo "can-publish=0" >> "$GITHUB_OUTPUT" | |
fi | |
release: | |
name: Releasing | |
needs: check-version | |
if: ${{ needs.check-version.outputs.can-publish == '1' }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setting up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
registry-url: "https://registry.npmjs.org" | |
cache: npm | |
- name: Installing dependencies | |
run: | | |
npm ci --no-audit --no-fund | |
- name: Extract package-version | |
run: echo "PACKAGE_VERSION=$(node -p -e 'require("./package.json").version')" >> "$GITHUB_ENV" | |
- name: package-version-to-git-tag | |
uses: pkgdeps/git-tag-action@ef111413f44ebe5cc05994e7f5b5b9edaaada08d # v3.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
github_repo: ${{ github.repository }} | |
version: ${{ env.PACKAGE_VERSION }} | |
git_commit_sha: ${{ github.sha }} | |
git_tag_prefix: "v" | |
- name: Publishing to npm | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |