forked from skunight/nestjs-redis
-
Notifications
You must be signed in to change notification settings - Fork 4
106 lines (92 loc) · 3.15 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
## ---------------------------------------------------
## |\---/|
## | ,_, | !! DO NOT MODIFY !!
## \_`_/-..----. file managed by `whiskers`
## ___/ ` ' ,""+ \
## (__...' __\ |`.___.';
## (_,...'(_,.`__)/'.....+
## ---------------------------------------------------
name: publish
run-name: publish v${{ inputs.version }}
on:
workflow_dispatch:
inputs:
branch:
description: The branch of the build. Used to find artifacts and tag.
required: true
release_type:
description: The type of release.
required: true
type: choice
options:
- experimental
- stable
default: experimental
version:
description: "The version of this release. Omit 'v' prefix. Example: '1.0.1-experimental.1'."
required: true
jobs:
version_bump:
name: version bump
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: git > checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
clean: true
fetch-depth: 1
token: ${{ secrets.BOT_GITHUB_TOKEN }}
ref: ${{ inputs.branch }}
- name: node > setup
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: .nvmrc
cache: yarn
- name: yarn > install
run: yarn install --frozen-lockfile
- name: yarn > bump version
run: yarn run release:version:bump ${{ inputs.version }}
- name: git > commit version bump
uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081
with:
default_author: github_actions
message: bump version to ${{ inputs.version }}
push: true
tag: v${{ inputs.version }}
publish:
name: publish
runs-on: ubuntu-latest
needs:
- version_bump
steps:
- name: git > checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
clean: true
fetch-depth: 1
token: ${{ secrets.BOT_GITHUB_TOKEN }}
ref: v${{ inputs.version }}
- name: node > setup
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: .nvmrc
cache: yarn
- name: yarn > install
run: yarn install --frozen-lockfile
- name: ci > download artifacts
uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e
with:
workflow: build.yaml
workflow_conclusion: success
branch: ${{ inputs.branch }}
- name: yarn > publish (experimental)
if: inputs.release_type == 'experimental'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run release:publish:experimental
- name: yarn > publish (stable)
if: inputs.release_type == 'stable'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run release:publish:stable