Skip to content

Commit

Permalink
fix: use maintained version check action
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed Aug 13, 2024
1 parent 7c067fb commit 35af480
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,34 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: package version check
uses: MontyD/package-json-updated-action
id: version-updated
with:
path: package.json
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
if: steps.version-updated.outputs.has-updated
if: steps.check.outputs.changed
uses: actions/setup-node@v2
with:
node-version: "21"
registry-url: "https://registry.npmjs.org"

- name: Install pnpm
if: steps.version-updated.outputs.has-updated
if: steps.check.outputs.changed
run: npm install -g pnpm

- name: Install dependencies
if: steps.version-updated.outputs.has-updated
if: steps.check.outputs.changed
run: pnpm install

- name: Build
if: steps.version-updated.outputs.has-updated
if: steps.check.outputs.changed
run: pnpm run build # Update or remove this line depending on your build process

- name: Publish to npm
if: steps.version-updated.outputs.has-updated
if: steps.check.outputs.changed
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_KEY }}
Expand Down

0 comments on commit 35af480

Please sign in to comment.