-
Notifications
You must be signed in to change notification settings - Fork 64
36 lines (33 loc) · 1.2 KB
/
publish.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
name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: "The tagged version to release."
required: true
type: "string"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run lint:ci
- run: |
IFS='@' read -a strarr <<< $(git describe --tags)
sed -i "s/\"version\": .*/\"version\": \"${strarr[1]}$(echo $([ ${strarr[0]} == "production" ] && echo "" || echo "-${strarr[0]}"))\",/" wormhole-connect/package.json
npm run build
cp README.md wormhole-connect/
cp wormhole-connect.png wormhole-connect/
cd wormhole-connect
npm publish --tag $(echo $([ ${strarr[0]} == "production" ] && echo "latest" || echo ${strarr[0]})) --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry