forked from multiversx/mx-sdk-js-core
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 982 Bytes
/
publish-not-main.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
34
35
36
37
38
39
40
name: Publish (not main)
on:
workflow_dispatch:
inputs:
channel:
type: choice
description: NPM channel
options:
- alpha
- beta
- previous
permissions:
contents: write
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_TAG=v$(node -p "require('./package.json').version")
gh release create --prerelease $RELEASE_TAG --target=$GITHUB_SHA --title="$RELEASE_TAG" --generate-notes
- run: npm ci
- run: npm test
- name: Publish to npmjs
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish --access=public --tag=${{ github.event.inputs.channel }}