Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- "v*"

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -18,11 +22,13 @@ jobs:
registry-url: https://registry.npmjs.org
cache: npm

# Trusted publishing (OIDC) needs npm 11.5.1 or newer; Node 22 ships an older npm.
- run: npm install -g npm@latest
- run: npm --version

- run: npm ci
- run: npm run build
- run: npm test

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,19 @@ npm run dev -- campaigns list --profile 1234567890

Requires Node.js 18+.

## Releasing

Releases publish to npm from GitHub Actions using [npm trusted publishing](https://docs.npmjs.com/trusted-publishers) (OIDC). No npm token is stored in the repository.

```bash
npm version 2.1.0 --no-git-tag-version # bump package.json and package-lock.json
git commit -am "Bump version to 2.1.0"
git push
git tag v2.1.0 && git push origin v2.1.0 # the tag push triggers .github/workflows/release.yml
```

The trusted publisher on npmjs.com must point at this repository (`cprice70/amazonads-cli`) and the workflow file name `release.yml`.

## License

MIT
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "CLI for Amazon Ads API",
"author": "Chris Price",
"license": "MIT",
"repository": "https://github.com/cprice70/amazonads-cli",
"repository": {
"type": "git",
"url": "git+https://github.com/cprice70/amazonads-cli.git"
},
"homepage": "https://github.com/cprice70/amazonads-cli#readme",
"keywords": [
"amazon",
Expand Down
Loading