Skip to content

Commit

Permalink
broken npm publish.. as usual
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-akins committed Dec 31, 2024
1 parent b24220f commit 7446a63
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ on:
jobs:
npm-publish:
name: npm-publish
if: contains(github.event.pull_request.title || github.event.head_commit.message, 'Release')
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./react

steps:
- name: Checkout repository
Expand All @@ -17,39 +21,17 @@ jobs:
with:
node-version: 20.x

- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install node dependencies
run: npm ci

- name: Audit dependencies for security vulnerabilities
run: npm audit

- name: Lint the source code
run: npm run-script lint
run: npm audit --omit=dev

- name: Build the source code
run: npm run build

- name: Execute test coverage
run: npm run-script coverage

- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@master
with: # All of theses inputs are optional
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "[\\s\\S]*Release (\\S+)"
- name: Publish to npm
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public

0 comments on commit 7446a63

Please sign in to comment.