-
-
Notifications
You must be signed in to change notification settings - Fork 11
89 lines (78 loc) · 2.24 KB
/
Copy pathgenerator.yml
File metadata and controls
89 lines (78 loc) · 2.24 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
on:
push:
branches:
- main
paths:
- '.github/workflows/generator.yml'
- 'generator/sonos-docs/src/**/*.ts'
- 'generator/sonos-docs/package.json'
pull_request:
branches:
- main
paths:
- '.github/workflows/generator.yml'
- 'generator/sonos-docs/src/**/*.ts'
- 'generator/sonos-docs/package.json'
release:
types: [published]
jobs:
test:
name: 'Build and test on Node ${{ matrix.node }}'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node: [22, 24]
defaults:
run:
working-directory: generator/sonos-docs
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build library
run: npm run build
- name: Run tests
run: npm test
npm-publish:
name: 'Publish to npm'
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
contents: read
id-token: write
packages: write
defaults:
run:
working-directory: generator/sonos-docs
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup node for npm registry
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Set version from release tag
run: npm version --no-git-tag-version "${{ github.event.release.tag_name }}"
- name: Build library
run: npm run prepack
- name: Publish to npm
run: npm publish --access public --provenance --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }}
- name: Setup node for GitHub Package Registry
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: 'https://npm.pkg.github.com'
scope: '@svrooij'
- name: Publish to GitHub Package Registry
run: npm publish --tag ${{ github.event.release.prerelease && 'beta' || 'latest' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}