Skip to content

Commit 7d4df73

Browse files
committed
package creation
0 parents  commit 7d4df73

File tree

6 files changed

+89
-0
lines changed

6 files changed

+89
-0
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
paths:
6+
- package.json
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions: write-all
11+
steps:
12+
13+
# Checkout the repository
14+
- uses: actions/checkout@v4
15+
16+
# Create a new version tag
17+
- uses: Klemensas/action-autotag@stable
18+
id: tag
19+
with:
20+
tag_prefix: v
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
23+
# Create the changelog
24+
- uses: heinrichreimer/[email protected]
25+
id: changelog
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
# Extract the release notes
30+
- uses: actions-ecosystem/action-regex-match@v2
31+
id: releasenotes
32+
with:
33+
text: ${{ steps.changelog.outputs.changelog }}
34+
regex: ^(\n|.)*?(##(.+)\n\n((\n|.)*?))(\n)+(##(\n|.)*)?(\n)+\\\*(.+)$
35+
36+
# Create a new GitHub release
37+
- uses: ncipollo/release-action@v1
38+
with:
39+
tag: ${{ steps.tag.outputs.tagname }}
40+
body: ${{ steps.releasenotes.outputs.group4 }}
41+
42+
# Publish a new NPM version
43+
- uses: JS-DevTools/npm-publish@v3
44+
with:
45+
access: public
46+
token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules/
2+
.DS_Store

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!/src/
3+
!/package.json
4+
!/README.md

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Module Name
2+
3+
Module description ...
4+
5+
## Installation
6+
7+
Module installation ...
8+
9+
## Usage
10+
11+
Module usage ...
12+
13+
## Development
14+
15+
- Commit changes with issue reference
16+
- Run `npm version patch | minor | major` and push changes
17+
- Let the workflow manage the release to GitHub and NPM

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "add-backend",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "src/index.js",
6+
"type": "module",
7+
"scripts": {
8+
"test": "",
9+
"preversion": "npm install && npm test"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/scriptpilot/add-backend.git"
14+
},
15+
"author": "scriptPilot <[email protected]>",
16+
"license": "MIT"
17+
}

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default () => {
2+
console.log('Hello World 🥳')
3+
}

0 commit comments

Comments
 (0)