Skip to content

Commit 045ffd4

Browse files
committed
feat: added publish workflow on npm
1 parent e4df5ed commit 045ffd4

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*' # publica apenas tags de versão semântica
9+
10+
jobs:
11+
publish:
12+
name: Publish Package
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
id-token: write
18+
environment: npm
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
registry-url: 'https://registry.npmjs.org/'
28+
29+
- name: Authenticate with npm using OIDC
30+
run: npm login --auth-type=oidc
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build package
36+
run: npm run build
37+
38+
- name: Publish package
39+
run: npm publish --access public

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# react-ads-sdk
22

3-
[![NPM Version](https://img.shields.io/npm/v/@luishoshina/react-ads-service)](https://www.npmjs.com/package/@luishoshina/react-ads-service)
3+
[![NPM Version](https://img.shields.io/npm/v/react-ads-sdk)](https://www.npmjs.com/package/react-ads-sdk)
44
[![License](https://img.shields.io/npm/l/@luishoshina/react-ads-service)](https://github.com/luishoshina/react-ads-service/blob/main/LICENSE)
55
[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
66
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@luishoshina/react-ads-service)](https://bundlephobia.com/package/@luishoshina/react-ads-service)

0 commit comments

Comments
 (0)