-
Notifications
You must be signed in to change notification settings - Fork 42
54 lines (47 loc) · 1.5 KB
/
release-npm-preview.yaml
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
name: Release to @preview tag on npm
on:
workflow_dispatch:
env:
BUILD_VERSION: ""
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-changesets:
name: Release to @preview tag on npm
runs-on: buildjet-4vcpu-ubuntu-2204
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: FuelLabs/github-actions/setups/node@master
with:
node-version: 20.11.0
pnpm-version: 9.5.0
- uses: FuelLabs/github-actions/setups/npm@master
with:
npm-token: ${{ secrets.NPM_TOKEN }}
- name: Build Lib
run: pnpm build
env:
## increase node.js m memory limit for building
## with sourcemaps
NODE_OPTIONS: "--max-old-space-size=4096"
- name: Release to @preview tag on npm
id: release
run: |
pnpm changeset version --snapshot preview
changetsets=$(pnpm changeset publish --tag preview)
echo "BUILD_VERSION=$(pnpm -s packages:version)" >> $GITHUB_ENV
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Comment release package name to PR
uses: mshick/add-pr-comment@v2
with:
message: |
This PR is published in NPM with version **${{ env.BUILD_VERSION }}**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}