From 39d0631bcb89e8bbc81d4c85670d2f0c8d57dfc0 Mon Sep 17 00:00:00 2001 From: Evan Gray Date: Tue, 12 Sep 2023 13:36:13 -0400 Subject: [PATCH] ci: manual publish action --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..46f3bc9a3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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