Skip to content

Commit 9e179b2

Browse files
committed
feat: add publish by github action
1 parent 186ab56 commit 9e179b2

File tree

4 files changed

+77
-6
lines changed

4 files changed

+77
-6
lines changed

.github/workflows/npm-publish.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: NPM publish
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
env:
9+
success:
10+
failure: 🔴
11+
cancelled:
12+
skipped:
13+
node_version: 20
14+
true:
15+
false: 🔴
16+
17+
jobs:
18+
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- id: release
25+
uses: halvardssm/[email protected]
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
path: "./package.json" # optional, will use ./package.json by default
29+
30+
- run: |
31+
echo 'Release created: ${{steps.release.outputs.release_created}}' # 'true' or 'false'
32+
echo 'Release exists: ${{steps.release.outputs.release_exists}}' # 'true' or 'false'
33+
echo 'Release tag: ${{steps.release.outputs.release_tag}}' # The tag from package.json
34+
35+
- name: Notification
36+
if: ${{ always() }}
37+
uses: appleboy/telegram-action@master
38+
with:
39+
token: ${{ secrets.BOT_TOKEN }}
40+
to: ${{ secrets.CHAT_ID }}
41+
message: |
42+
Repository: ${{ github.repository }}
43+
Release : ${{ env[steps.release.outputs.release_created] }}
44+
Tag: ${{ steps.release.outputs.release_tag }}
45+
46+
47+
publish-npm:
48+
needs: release
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v3
52+
53+
- uses: actions/setup-node@v3
54+
with:
55+
node-version: 20
56+
registry-url: https://registry.npmjs.org/
57+
58+
- run: npm ci
59+
- run: npm publish
60+
env:
61+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
62+
63+
- name: Notification
64+
if: ${{ always() }}
65+
uses: appleboy/telegram-action@master
66+
with:
67+
token: ${{ secrets.BOT_TOKEN }}
68+
to: ${{ secrets.CHAT_ID }}
69+
message: |
70+
Repository: ${{ github.repository }}
71+
npm publish : ${{ env[job.status] }}

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# 1.2.0
1+
# 2.0.0
22

33
⚠️ BREAKING CHANGE
44

55
[@adonisjs/drive](https://docs.adonisjs.com/guides/digging-deeper/drive) is required
66

77
***Config basePath is deleted, replace by location option of fs service***
88

9-
***Refacto getUrl() view helper, [add await](https://github.com/batosai/adonis-attachment/tree/1.2.0?tab=readme-ov-file#urls)***
9+
***Refacto getUrl() view helper, [add await](https://github.com/batosai/adonis-attachment?tab=readme-ov-file#urls)***
1010

11-
***Access [serialize](https://github.com/batosai/adonis-attachment/tree/1.2.0?tab=readme-ov-file#by-serialize) is update***
11+
***Access [serialize](https://github.com/batosai/adonis-attachment?tab=readme-ov-file#by-serialize) is update***
1212

1313
* support @adonisjs/drive
1414
* dependencies update

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Project sample : [adonis-starter-kit](https://github.com/batosai/adonis-starter-
1818
- [ ] edge component
1919
- [x] serialize
2020

21-
⚠️ Breaking change [1.2.0 version](https://github.com/batosai/adonis-attachment/blob/1.2.0/CHANGELOG.md), include [@adonisjs/drive](https://docs.adonisjs.com/guides/digging-deeper/drive)
21+
⚠️ Breaking change [2.0.0 version](https://github.com/batosai/adonis-attachment/blob/main/CHANGELOG.md), include [@adonisjs/drive](https://docs.adonisjs.com/guides/digging-deeper/drive)
2222

2323
### File sytem
2424

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jrmc/adonis-attachment",
3-
"version": "1.2.0-1",
3+
"version": "2.0.0",
44
"type": "module",
55
"description": "Turn any field on your Lucid model to an attachment data type",
66
"engines": {
@@ -78,7 +78,7 @@
7878
"prettier": "@adonisjs/prettier-config",
7979
"publishConfig": {
8080
"access": "public",
81-
"tag": "beta"
81+
"tag": "latest"
8282
},
8383
"volta": {
8484
"node": "20.16.0"

0 commit comments

Comments
 (0)