Skip to content

Commit 90ed97e

Browse files
committed
feat: version funcional de librería con actions
1 parent 29cc49f commit 90ed97e

File tree

4 files changed

+71
-1
lines changed

4 files changed

+71
-1
lines changed

.github/workflows/publish.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release & Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
release:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0 # required for tags
22+
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 18
27+
registry-url: 'https://registry.npmjs.org/'
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build library
33+
run: npm run ngx-notion-cms:build
34+
35+
- name: Generate release & changelog
36+
run: npm run release:ci
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Publish to npm
41+
run: npm publish dist/ngx-notion-cms/ --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
45+
- name: Push release changes
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
git push --follow-tags origin main

.releaser.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"types": [
3+
{ "type": "feat", "section": "✨ Features" },
4+
{ "type": "fix", "section": "🐛 Fixes" },
5+
{ "type": "chore", "section": "🧹 Chores", "hidden": false },
6+
{ "type": "docs", "section": "📝 Docs" },
7+
{ "type": "style", "section": "💅 Styles" },
8+
{ "type": "refactor", "section": "🔨 Refactors" },
9+
{ "type": "test", "section": "🧪 Tests" }
10+
],
11+
"skip": {
12+
"commit": false,
13+
"tag": false
14+
},
15+
"commitAll": true
16+
}
17+

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
Este archivo sigue el formato de [Conventional Commits](https://www.conventionalcommits.org) y es generado automáticamente por `standard-version`.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"test": "ng test",
1212
"lint": "ng lint",
1313
"prepare": "husky",
14-
"migrate:signals": "ng generate @angular/core:signals",
14+
"release": "standard-version",
15+
"release:ci": "standard-version --no-verify --no-commit-hooks",
1516
"ngx-notion-cms:lint": "ng lint ngx-notion-cms",
1617
"ngx-notion-cms:test": "ng test ngx-notion-cms --no-watch --no-progress --browsers=ChromeHeadless",
1718
"ngx-notion-cms:build": "ng build ngx-notion-cms --configuration production",

0 commit comments

Comments
 (0)