-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (40 loc) · 1.41 KB
/
public-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# .github/workflows/release.yml
name: Publish canvacard
on:
release:
types: [published] # Se activa cuando se publica un release
jobs:
publish:
name: Build & Publish canvacard
runs-on: ubuntu-latest
permissions:
id-token: write # Necesario si utilizas autenticación OIDC con NPM
steps:
# Checkout del código del repositorio
- name: Checkout repository
uses: actions/checkout@v4
# Configurar la identidad de Git desde secrets
- name: Set Git Identity
run: |
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
# Instalar pnpm
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: latest
# Instalar Node.js y configurar el registro de NPM
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
# Instalar las dependencias
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
# Publicar el paquete en NPM
- name: Publish to NPM
run: pnpm publish --provenance --access public --no-git-checks # Publica el paquete en NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} # Autenticación con NPM