1
0
mirror of synced 2025-12-11 08:53:55 +08:00
Files
Mergely/.github/workflows/npm-release.yaml
2021-11-21 13:01:09 +00:00

35 lines
853 B
YAML

name: Release latest on npm
on:
workflow_dispatch:
inputs:
jobs:
tag-and-publish:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 10
registry-url: https://registry.npmjs.org
- name: Git checkout
uses: actions/checkout@v2
- name: Get package version
run: |
export VERSION=`cat package.json | grep '"version"' | sed -E 's/\s+"version": "(.*)",/\1/'`
echo "PKG_VERSION=$VERSION" >> $GITHUB_ENV
- name: Update dist-tag
run: npm dist-tag add mergely@${PKG_VERSION} latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Remove 'next' dist-tag
run: npm dist-tag rm mergely next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}