-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (68 loc) · 2.23 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (68 loc) · 2.23 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
name: Release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
jobs:
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: RC gates
run: pnpm check:rc
- name: Package CDN artifact
run: |
VERSION=$(cat VERSION)
mkdir -p release-assets
cp bundle/cdn/dist/tradview.min.js "release-assets/tradview.min.js"
gzip -c bundle/cdn/dist/tradview.min.js > "release-assets/tradview.min.js.gz"
cp bundle/cdn-webgl/dist/tradview-webgl.min.js "release-assets/tradview-webgl.min.js"
gzip -c bundle/cdn-webgl/dist/tradview-webgl.min.js > "release-assets/tradview-webgl.min.js.gz"
echo "${VERSION}" > release-assets/VERSION.txt
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
release-assets/tradview.min.js
release-assets/tradview.min.js.gz
release-assets/tradview-webgl.min.js
release-assets/tradview-webgl.min.js.gz
release-assets/VERSION.txt
publish-npm:
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Use npm CLI with OIDC trusted publishing
run: npm install -g npm@11.5.1
- run: pnpm install --frozen-lockfile
- name: RC gates
run: pnpm check:rc
- name: Publish packages to npm (OIDC trusted publishing)
run: node scripts/publish-ordered.mjs