Skip to content
This repository was archived by the owner on May 18, 2021. It is now read-only.

Commit bf55063

Browse files
committed
👷 Automated version bump / publish
1 parent 5a64a6c commit bf55063

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

‎.github/workflows/publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Version and Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
newversion:
7+
description: "Semantic Version Bump Type (major minor patch)"
8+
default: patch
9+
10+
env:
11+
node_version: 14
12+
13+
jobs:
14+
version_and_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js ${{ env.node_version }}
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ env.node_version }}
22+
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
23+
registry-url: "https://registry.npmjs.org"
24+
- run: yarn install
25+
- run: git config --global user.name github-action
26+
- run: git congig --global user.email [email protected]
27+
- run: yarn version --${{ github.event.inputs.newversion }}
28+
- name: get-npm-version
29+
id: package-version
30+
uses: martinbeentjes/npm-get-version-action@master
31+
- run: yarn publish . --new-version ${{ steps.package-version.outputs.current-version}}
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"lint": "vue-cli-service lint",
1414
"package": "vue-cli-service build --target lib src/wrapper.ts",
1515
"prepublishOnly": "npm run package",
16+
"postpublish": "git push --follow-tags",
1617
"test": "vue-cli-service lint"
1718
},
1819
"unpkg": "dist/package/viewer.umd.min.js",

0 commit comments

Comments
 (0)