chore(ci): added workflows

This commit is contained in:
Jamie Peabody
2021-11-21 10:59:22 +00:00
parent 623a93b838
commit addc610457
3 changed files with 121 additions and 0 deletions

34
.github/workflows/npm-release.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
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/.*: "(.*)",/\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 }}