diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index a9732a0..a99cba5 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,29 +1,39 @@ -name: Publish Package to npmjs +name: Publish package to npmjs + on: release: types: [published] + jobs: - build: + publish_npm: runs-on: ubuntu-latest + permissions: contents: read id-token: write packages: write - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - run: | - echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc - echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc + steps: + - name: Checkout code + uses: actions/checkout@v4 - - run: yarn + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 - # Change the registry to npmjs (to publish) - - run: | + - name: Create .npmrc file + run: | echo "registry=https://registry.npmjs.org/" > .npmrc echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc - - run: npm publish --scope=@internxt --access public + - name: Publish package to npm + run: npm publish --scope=@internxt --access public + + - name: Create .npmrc file + run: | + echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc + + - name: Publish package to github + run: npm publish --scope=@internxt --access public diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 5df91f7..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish Scan package in github package registry -on: - release: - types: [created] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [22.12.0] - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v2 - # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.node-version}} - registry-url: 'https://npm.pkg.github.com' - - run: yarn - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: yarn publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index d58c3ff..f5357be 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/scan", - "version": "1.0.3", + "version": "1.0.7", "author": "Kyle Farris (https://infotechinc.com)", "description": "Use Node JS to scan files on your server with ClamAV's clamscan/clamdscan binary or via TCP to a remote server or local UNIX Domain socket. This is especially useful for scanning uploaded files provided by un-trusted sources.", "main": "index.js", @@ -17,9 +17,9 @@ ], "scripts": { "docs": "jsdoc2md index.js lib/* > API.md", - "format": "node_modules/.bin/prettier '**/*.{js,json}' --write", - "lint": "node_modules/.bin/eslint '**/*.js'", - "lint:fix": "node_modules/.bin/eslint --fix '**/*.js'", + "format": "prettier '**/*.{js,json}' --write", + "lint": "eslint '**/*.js'", + "lint:fix": "eslint --fix '**/*.js'", "test": "make test" }, "keywords": [