Skip to content

Commit 7058476

Browse files
committed
feat: add publish zip pipeline
1 parent 1357c60 commit 7058476

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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

0 commit comments

Comments
 (0)