-
Notifications
You must be signed in to change notification settings - Fork 9
33 lines (33 loc) · 1.28 KB
/
prerelease.yml
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
on:
pull_request:
branches: [master]
name: prerelease
jobs:
prerelease:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 20
uses: actions/setup-node@v2
with:
node-version: 20
- run: yarn install --immutable
- run: yarn dist
- run: npm version prerelease --preid=$GITHUB_HEAD_REF-`git rev-parse --short HEAD` --git-tag-version=false --commit-hooks=false
- run: |
npm config set registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
npm publish --tag $GITHUB_HEAD_REF
- name: Extract NPM package name
run: echo "::set-output name=npm-name::`node -p -e "require('./package.json').name"`"
id: npm-name
- name: Extract npm package version
run: echo "::set-output name=npm-version::`node -p -e "require('./package.json').version"`"
id: npm-version
- name: Comment PR
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
message: |
Released prerelease version `${{ steps.npm-version.outputs.npm-version }}`.
You may now run `npm install ${{ steps.npm-name.outputs.npm-name }}@${{ github.head_ref }}`