Skip to content

Commit

Permalink
ci: manual publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Sep 12, 2023
1 parent f7e4384 commit 39d0631
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
pull_request:
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: ref/tags/${{ inputs.tag }}
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: npm run lint:ci
- run: npm run build
- run: |
cd wormhole-connect-loader
IFS='@' read -a strarr <<< $(git describe --tags)
sed -i "s/\"version\": .*/\"version\": \"${strarr[1]}$(echo $([ ${strarr[0]} == "production" ] && echo "" || echo "-${strarr[0]}"))\",/" package.json
npm publish --tag $(echo $([ ${strarr[0]} == "production" ] && echo "latest" || echo ${strarr[0]})) --access public --dry-run

0 comments on commit 39d0631

Please sign in to comment.