-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (100 loc) · 3.15 KB
/
npm.yml
File metadata and controls
101 lines (100 loc) · 3.15 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
90
91
92
93
94
95
96
97
98
99
100
101
name: 'Publish to npm'
on:
release:
types: [published]
push:
tags:
- '*.*.*-build.*'
jobs:
release:
name: Publish stable release
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Set up NodeJS LTS
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Update npm package manager
run: npm install -g npm@latest
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: npm i
- name: Bump package.json version from tag
uses: TypescriptPrime/bump-packagejson-version@cedd67a09090f3ad9334349d3d0bc1a795a1a149
- name: Build
run: npm run build
- name : Publish to npm
run: npm publish --access public
if: ${{ github.event_name == 'release' && github.event.release.prerelease == false }}
beta-release:
name: Publish beta release
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Set up NodeJS LTS
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Update npm package manager
run: npm install -g npm@latest
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: npm i
- name: Bump package.json version from tag
uses: TypescriptPrime/bump-packagejson-version@cedd67a09090f3ad9334349d3d0bc1a795a1a149
- name: Build
run: npm run build
- name : Publish to npm
run: npm publish --tag beta --access public
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true && contains(github.event.release.tag_name, '-beta.') }}
build-release:
name: Build release (no publish)
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Set up NodeJS LTS
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Update npm package manager
run: npm install -g npm@latest
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
run: npm i
- name: Bump package.json version from tag
uses: TypescriptPrime/bump-packagejson-version@cedd67a09090f3ad9334349d3d0bc1a795a1a149
- name: Build
run: npm run build
- name : Publish to npm
run: npm publish --tag build --access public
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-build.') }}
purge:
name: Purge jsdelivr cache
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- name: Set up NodeJS LTS
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Purge jsdelivr cache
uses: FilteringDev/jsdelivr-purge-npm@1.0.7
with:
package: '@filteringdev/tinyshield'
disttag: 'latest'
needs: [release]