-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1000 Bytes
/
publish.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
name: Publish
on:
workflow_run:
workflows: [CI]
branches: [main]
types: [completed] # Attiva quando il workflow CI è completato
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }} # Verifica che CI sia completato con successo e l'evento sia un push
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Create and publish a release with changesets
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}