-
Notifications
You must be signed in to change notification settings - Fork 9
53 lines (48 loc) · 1.52 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
50
51
52
53
name: Publish
on:
release:
types:
- published
workflow_dispatch:
inputs:
version:
description: 'Auto-increment current version by'
required: true
type: choice
options:
- patch
- minor
- major
confirm:
description: 'Type `yes` to confirm to publish the package into the NPM registry and create a version commit and tag'
required: true
type: string
env:
FORCE_COLOR: 3
jobs:
publish:
if: inputs.confirm == 'yes'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: echo "Version $VERSION | Confirm $CONFIRM"
env:
VERSION: ${{ inputs.version }}
CONFIRM: ${{ inputs.confirm }}
- run: yarn install --frozen-lockfile
- run: yarn make:4byte
- run: yarn compile
- run: yarn lint
- run: yarn test
- name: 'Set up git user to be able to commit, tag and push'
run: |
git config --global user.name 'acuarica'
git config --global user.email 'acuarica@users.noreply.github.com'
- name: 'Bump ${{ inputs.version }} in `package.json`, publish into NPM registry and commit and tag this release'
run: 'yarn publish --new-version ${{ inputs.version }} --message ":rocket: Bump new version v%s"'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: 'Push bumped `package.json` commit and newly created tag for this release'
run: |
git push
git push --tags