-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.12 KB
/
version.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version to pass to release.sh [vX.X.X]'
required: true
jobs:
version:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
# pull all the branches and tags
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Install git-chglog
run: |
curl https://i.jpillora.com/git-chglog/git-chglog! | sudo bash
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm install
- name: Setup git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: npm version
run: |
npm version ${{ github.event.inputs.version }}
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
branch: ${{ github.ref }}
- name: Create Release
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
token: ${{ secrets.ORG_NPM_TOKEN }}