Skip to content

Commit 46a2e6e

Browse files
authored
task: add auto (#32)
Add [`auto`](https://intuit.github.io/auto/docs/welcome/getting-started) for automatic tagging, versioning and publishing.
1 parent e534e60 commit 46a2e6e

File tree

3 files changed

+1106
-30
lines changed

3 files changed

+1106
-30
lines changed

.github/workflows/onPushToMain.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ jobs:
3636
run: npm install -g npm@^11.5.1
3737

3838
- name: Create Release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.DISPATCH_ACCESS_TOKEN }}
41+
NPM_TOKEN: '' # placeholder to prevent yarn from failing on ${NPM_TOKEN} expansion (OIDC token is written to ~/.npmrc by auto)
3942
run: |
4043
yarn install --frozen-lockfile
41-
yarn prepack
42-
npm publish --provenance --access public
44+
yarn build
45+
yarn release

package.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@oclif/core": "^4.4.0",
2222
"@oclif/plugin-autocomplete": "^3.2.31",
2323
"@oclif/plugin-help": "^6.2.29",
24+
"auto": "^11.3.6",
2425
"zod": "^4.2.1"
2526
},
2627
"devDependencies": {
@@ -53,14 +54,21 @@
5354
"identifier": "com.gr4vy.cli"
5455
}
5556
},
57+
"auto": {
58+
"plugins": [
59+
"npm",
60+
"released"
61+
]
62+
},
5663
"scripts": {
5764
"build": "shx rm -rf dist && tsc -b",
5865
"lint": "eslint . --ext .ts --config .eslintrc.js",
5966
"postpack": "shx rm -f oclif.manifest.json",
6067
"posttest": "yarn lint",
6168
"prepack": "yarn build && oclif manifest && oclif readme",
6269
"test": "echo \"No tests\"",
63-
"version": "oclif readme && git add README.md"
70+
"version": "oclif readme && git add README.md",
71+
"release": "auto shipit"
6472
},
6573
"engines": {
6674
"node": ">=12.0.0"
@@ -69,5 +77,10 @@
6977
"keywords": [
7078
"oclif"
7179
],
72-
"types": "dist/index.d.ts"
80+
"types": "dist/index.d.ts",
81+
"publishConfig": {
82+
"access": "public",
83+
"registry": "https://registry.npmjs.org",
84+
"provenance": true
85+
}
7386
}

0 commit comments

Comments
 (0)