File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish templates
2
+ run-name : CD-${{ github.run_id }}-${{ inputs.publish-branch }}-${{ inputs.release-type }}
3
+
4
+ on :
5
+ workflow_dispatch :
6
+ inputs :
7
+ publish-branch :
8
+ description : " default is 'ai-toolkit'"
9
+ required : true
10
+ type : string
11
+ default : ' ai-toolkit'
12
+ release-type :
13
+ description : " release type(alpha, rc, stable)"
14
+ required : true
15
+ default : " alpha"
16
+
17
+ permissions :
18
+ contents : read
19
+
20
+ jobs :
21
+ publish :
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - name : Validate release type
25
+ if : ${{ github.event.inputs.release-type != 'alpha' && github.event.inputs.release-type != 'rc' && github.event.inputs.release-type != 'stable' }}
26
+ run : |
27
+ echo "Invalid release type '${{ github.event.inputs.release-type }}' provided. Valid values are 'alpha', 'rc', 'stable'."
28
+ exit 1
29
+
30
+ - name : Checkout branch
31
+ uses : actions/checkout@v4
32
+ with :
33
+ fetch-depth : 0
34
+ ref : ${{ github.event.inputs.publish-branch }}
35
+
36
+ - name : Create template ZIP file
37
+ run : zip -r template.zip .
38
+
39
+ - name : Get current timestamp
40
+ run : echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
41
+
42
+ - name : Set template name
43
+ run : |
44
+ if [ "${{ github.event.inputs.release-type }}" == "alpha" ]; then
45
+ echo "TEMPLATE_NAME=template-${{ env.TIMESTAMP }}-alpha" >> $GITHUB_ENV
46
+ elif [ "${{ github.event.inputs.release-type }}" == "rc" ]; then
47
+ echo "TEMPLATE_NAME=template-${{ env.TIMESTAMP }}-rc" >> $GITHUB_ENV
48
+ else
49
+ echo "TEMPLATE_NAME=template-${{ env.TIMESTAMP }}" >> $GITHUB_ENV
50
+ fi
51
+
52
+ - name : Upload template ZIP file
53
+ uses : actions/upload-artifact@v4
54
+ with :
55
+ name : ${{ env.TEMPLATE_NAME }}
56
+ path : template.zip
You can’t perform that action at this time.
0 commit comments