-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (59 loc) · 1.74 KB
/
publish.yml
File metadata and controls
70 lines (59 loc) · 1.74 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Publish Package
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build
run: npm run build
# Configure npm registry for publishing
- name: Setup Node.js for npm
uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
title: 'chore: version packages'
commit: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_PROVENANCE: true
# Only publish to GitHub Packages if npm publish succeeded
- name: Setup Node.js for GitHub Packages
if: steps.changesets.outputs.published == 'true'
uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@taskade'
- name: Publish to GitHub Packages
if: steps.changesets.outputs.published == 'true'
run: npm publish --registry=https://npm.pkg.github.com --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}