-
Notifications
You must be signed in to change notification settings - Fork 200
88 lines (82 loc) · 3.22 KB
/
publish.yml
File metadata and controls
88 lines (82 loc) · 3.22 KB
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
name: Publish release
run-name: Publish release ${{ inputs.package_name }} ${{ inputs.custom_version || inputs.version_type }}, close_milestone is ${{ inputs.close_milestone }} (tag ${{ inputs.npm_tag || 'see in workflow' }})
on:
workflow_dispatch:
inputs:
package_name:
description: "[1] Package's name:"
required: true
type: choice
options:
- "@vkontakte/vkui"
- "@vkontakte/vkui-floating-ui"
- "@vkontakte/vkui-date-fns-tz"
- "@vkontakte/vkui-codemods"
- "@vkontakte/vkui-mcp"
version_type:
description: "[2] Version type (!!! CHOOSE THE RIGHT BRANCH BEFORE !!!):"
required: true
type: choice
options:
- patch
- minor
- major
- prepatch
- preminor
- premajor
- prerelease
prerelease_id:
description: "[3] NPM preid, ex, 0.0.0-beta.0 (it will be enabled only for pre-releases):"
required: false
type: choice
default: "beta"
options:
- alpha
- beta
- rc
npm_tag:
description: "[4] NPM tag (for stable release default is 'latest', for pre-release is preid)"
required: false
close_milestone:
description: "Whether to close associated milestone after publish (milestone should be exist)"
type: boolean
default: true
custom_version:
description: "Custom SemVer version (it will disable steps [2] and [3]):"
required: false
jobs:
publish:
concurrency: ci-gh-pages
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
- name: Setting up the repository environment
uses: ./.github/actions/publish-workflow-1-setup
- name: Bump version
id: updated_versions_info
uses: ./.github/actions/publish-workflow-2-bump-version
with:
package_name: ${{ inputs.package_name }}
version_type: ${{ inputs.custom_version || inputs.version_type }}
prerelease_id: ${{ inputs.prerelease_id }}
- name: Run pre-publish checks
uses: ./.github/actions/publish-workflow-3-validation
with:
package_name: ${{ inputs.package_name }}
- name: Complete publish (for prerelease)
uses: ./.github/actions/publish-workflow-4-complete
with:
branch: ${{ github.ref }}
prev_version: ${{ steps.updated_versions_info.outputs.prev_version }}
next_version: ${{ steps.updated_versions_info.outputs.next_version }}
package_name: ${{ inputs.package_name }}
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
npm_tag: ${{ inputs.npm_tag || (fromJson(steps.updated_versions_info.outputs.is_stable_release) == true && 'latest') || inputs.prerelease_id }}
close_milestone: ${{ inputs.close_milestone == true }}
disable_git_tag_with_namespace: ${{ inputs.package_name == '@vkontakte/vkui' }}
prerelease: ${{ fromJson(steps.updated_versions_info.outputs.is_stable_release) == false }}