diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6130911..d527133 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,9 +3,12 @@ name: Test on: push: branches: - - main + - main pull_request: +permissions: + content: read + jobs: setup: name: Setup @@ -13,30 +16,41 @@ jobs: outputs: nodes: ${{ steps.nodes.outputs.nodes }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 - name: Setup Node Version Matrix id: nodes run: | NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -) echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT + lint: + runs-on: ubuntu-latest + needs: setup + steps: + - uses: actions/checkout@v6 + - name: Use Node.js 24.x + uses: actions/setup-node@v6 + with: + node-version: 24.x + - run: npm i + - run: npm run lint + test: - # uses: pkgjs/action/.github/workflows/node-test.yaml@v0 runs-on: ubuntu-latest needs: setup strategy: matrix: node-version: ${{ fromJson(needs.setup.outputs.nodes) }} steps: - - uses: actions/checkout@v4 - - name: Setup git user - run: | - git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" - git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: npm install and test - run: npm it + - uses: actions/checkout@v6 + - name: Setup git user + run: | + git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" + git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - name: npm install and test + run: npm it diff --git a/package.json b/package.json index 1987763..b6d863c 100644 --- a/package.json +++ b/package.json @@ -8,13 +8,15 @@ "create-package-json": "bin/create-package-json" }, "scripts": { - "test": "semistandard && mocha", + "test": "mocha", "test:debug": "mocha --inspect --inspect-brk --timeout=0", "test:cover": "c8 mocha", + "lint": "semistandard", "lint:fix": "semistandard --fix", "debug": "mocha --inspect --inspect-brk", - "release": "npm t && standard-version && npm publish", - "postpublish": "git push && git push --tags" + "prerelease": "npm run lint && npm test && standard-version && npm login", + "release": "npm publish --access=public --tag=\"${1:-latest}\"", + "postrelease": "(npm logout || true) && git push --follow-tags && gh release create --draft --generate-notes \"v$(cat package.json | jq -r .version)\"" }, "repository": { "type": "git",