-
Notifications
You must be signed in to change notification settings - Fork 92
85 lines (75 loc) · 2.29 KB
/
trigger_from_labelu_kit.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
85
name: 'Updating .version triggered from LabelU-Kit'
on:
workflow_dispatch:
inputs:
branch:
description: 'Frontend branch'
required: true
default: 'release'
type: choice
options:
- release
- alpha
version:
description: 'Current frontend version'
required: true
type: string
release_type:
description: 'Release type(fix, feat, breaking-change)'
required: true
type: choice
default: 'fix'
options:
- fix
- feat
- breaking-change
changelog:
description: 'Frontend changelog'
required: false
assets_url:
description: 'Frontend assets url'
required: true
type: string
jobs:
update-frontend:
strategy:
fail-fast: false
matrix:
node-version: [20.8.1]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
permissions:
actions: write
contents: write
issues: write
pull-requests: write
id-token: write
steps:
# ====================== frontend ======================
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Update .VERSION file
run: |
sh ./scripts/resolve_frontend.sh ${{ github.ref_name }} $FRONTEND_VERSION $FRONTEND_ASSET_URL
env:
FRONTEND_VERSION: ${{ inputs.version }}
FRONTEND_ASSET_URL: ${{ inputs.assets_url }}
CURRENT_BRANCH: ${{ github.ref_name }}
- name: Commit .VERSION file
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '${{ inputs.release_type }}: Upgrade frontend to ${{ inputs.version }}. See the details in [release notes](https://github.com/opendatalab/labelU-Kit/releases/tag/${{ inputs.version }})'
file_pattern: .VERSION
- name: Prepare changelog
id: set_changelog
run: |
echo "CHANGE_LOG=$(echo '${{ inputs.changelog }}' | sed ':a;N;$!ba;s/\n/\\n/g')" >> $GITHUB_ENV
- name: Trigger release workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release
inputs: |
{
"changelog": "${{ env.CHANGE_LOG }}"
}