-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (49 loc) · 1.76 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "publish"
on:
release:
types: [published]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- name: Set release version
id: vars
run: echo ::set-output name=tag::$(echo ${{ github.event.release.tag_name }} | cut -d "v" -f 2)
- uses: actions/setup-node@v2
with:
always-auth: true
node-version: "13.x"
registry-url: "https://registry.npmjs.org"
scope: "@minddoc"
- name: Publish the package
run: |
npm --no-git-tag-version version $RELEASE_VERSION
npm config set registry https://registry.npmjs.org
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
publish-github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.4.0
- name: Set release version
id: vars
run: echo ::set-output name=tag::$(echo ${{ github.event.release.tag_name }} | cut -d "v" -f 2)
- uses: actions/setup-node@v2
with:
node-version: "13.x"
registry-url: "https://npm.pkg.github.com"
scope: "@minddocdev"
- name: Publish the package
run: |
sed -i 's/@minddoc/@minddocdev/g' package.json
npm --no-git-tag-version version $RELEASE_VERSION
npm config set registry https://npm.pkg.github.com
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.MINDDOCBOT_TOKEN }}
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}