Skip to content

Commit

Permalink
feat: init repository
Browse files Browse the repository at this point in the history
  • Loading branch information
tasshi-me committed Oct 18, 2024
1 parent c111bc5 commit 125d4e3
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release
on:
push:
branches:
- main

jobs:
release:
name: Create draft release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4
id: release

publish-npm:
name: Publish to npm
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
needs: [release]
if: ${{ needs.release.outputs.release_created }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- name: Configure npm user
run: npm config set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm publish --access public
env:
# https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools
NPM_CONFIG_PROVENANCE: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules

.idea
.vscode
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
2 changes: 2 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
console.log("This is the test CLI!")
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@tasshi/demo-publish-node-cli-tool",
"version": "1.0.0",
"description": "Demo repository publishing Node.js based CLI to npm registry using pnpm",
"publishConfig": {
"access": "public"
},
"author": "Masaharu TASHIRO <tasshi.me@gmail.com>",
"bin": {
"demo-cli": "cli.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tasshi-playground/demo-publish-node-cli-tool.git"
},
"files": [
"CHANGELOG.md",
"cli.js"
],
"bugs": {
"url": "https://github.com/tasshi-playground/demo-publish-node-cli-tool/issues"
},
"homepage": "https://github.com/tasshi-playground/demo-publish-node-cli-tool/#readme",
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@8.15.9",
"keywords": [],
"license": "MIT"
}
16 changes: 16 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"packages": {
".": {
"release-type": "node",
"prerelease": false,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"changelog-path": "CHANGELOG.md",
"versioning": "default",
"include-component-in-tag": false,
"include-v-in-tag": true,
"pull-request-title-pattern": "chore: release ${version} from ${branch}",
"component-no-space": true
}
}
}

0 comments on commit 125d4e3

Please sign in to comment.