Skip to content

chore: fix npm search ranking for the CLI package #15

chore: fix npm search ranking for the CLI package

chore: fix npm search ranking for the CLI package #15

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
package-manager-cache: false
- name: Test
run: |
go test ./...
sh ./scripts/test-npm.sh
- name: Vulnerability scan
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
- name: Release with GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
version: v2.17.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
- name: Save npm release assets
uses: actions/upload-artifact@v4
with:
name: npm-release-assets
path: |
dist/etherscan_*.tar.gz
dist/etherscan_*.zip
dist/checksums.txt
if-no-files-found: error
npm:
if: vars.NPM_PUBLISH_ENABLED == 'true'
needs: release
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Download npm release assets
uses: actions/download-artifact@v5
with:
name: npm-release-assets
path: dist
- name: Publish npm package
run: node npm/publish.js
env:
NPM_PROVENANCE: "true"