-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.21 KB
/
release.yml
File metadata and controls
45 lines (37 loc) · 1.21 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
name: Release
on:
release:
types: [created]
jobs:
build:
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.x"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build-ts
# Tarball name matches npm’s naming for this scoped package (see npm pack output)
- name: Pack the npm package
id: pack
run: echo "filename=$(npm pack | tail -1)" >> "$GITHUB_OUTPUT"
- name: Publish to npm
id: publish_npm
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
# access: public # Uncomment if this package’s first npm publish must be public
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.pack.outputs.filename }}
asset_name: ${{ steps.pack.outputs.filename }}
asset_content_type: application/gzip