-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.63 KB
/
release.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
80
81
82
83
84
# **What it does:** Creates a release for the library, after checking there are changes that need releasing
# **Why we have it:** To automate the tagging the process
# **Who does it impact:** LI Engineering teams
name: Release Library
run-name: ${{ github.ref_name }}/${{ github.workflow }}
on:
workflow_dispatch:
inputs:
release_type:
type: choice
default: "minor"
description: Semantic Version
options:
- "major"
- "minor"
source_branch:
description: Source Branch
type: string
default: develop
required: true
base_branch:
description: Base Branch
type: string
default: master
required: true
jobs:
check-component-for-changes:
uses: ripjar/component-workflows/.github/workflows/check-node-component-for-changes.yaml@v2
with:
component_branch: ${{ inputs.source_branch }}
component_base_branch: ${{ inputs.base_branch }}
secrets: inherit
release-component:
uses: ripjar/component-workflows/.github/workflows/release-node-component.yaml@v2
needs: [ check-component-for-changes ]
if: needs.check-component-for-changes.outputs.is_release_required == '1'
with:
product: LI
node_version: 20
component_branch: ${{ inputs.source_branch }}
component_base_branch: ${{ inputs.base_branch }}
release_type: ${{ inputs.release_type }}
secrets: inherit
extract-version:
runs-on: arc
if: always()
needs: [ release-component ]
outputs:
version: ${{ steps.package_version.outputs.VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ inputs.base_branch }}
- name: Get version from package.json
id: package_version
run: echo "::set-output name=VERSION::$(jq -r '.version' package.json)"
shell: bash
bump-component-version:
uses: ripjar/component-workflows/.github/workflows/bump-node-component-version.yaml@v2
needs: [ release-component ]
secrets: inherit
with:
component_branch: ${{ inputs.source_branch }}
notify:
needs: [check-component-for-changes, release-component, extract-version, bump-component-version]
if: always()
uses: ripjar/li-ci-cd/.github/workflows/li-release-notify.yaml@develop
secrets: inherit
with:
repository_name: ${{ github.repository }}
is_release_required: ${{ needs.check-component-for-changes.outputs.is_release_required }}
release_result: ${{ needs.release-component.result }}
version: ${{ needs.extract-version.outputs.version }}
channel_id: 'C06PLQQEZRA'