Skip to content

Commit

Permalink
Merge pull request #150 from microsoft/feat/publish-pipeline
Browse files Browse the repository at this point in the history
refactor: add tag control to publish pipeline
  • Loading branch information
xiaolang124 authored Aug 12, 2024
2 parents fe18e17 + 53fc25a commit 413879e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
description: "release type(alpha, rc, stable)"
required: true
default: "alpha"
add-tag:
description: "add tag to the release"
required: true
default: "false"

permissions:
contents: read
Expand All @@ -27,6 +31,12 @@ jobs:
echo "Invalid release type '${{ github.event.inputs.release-type }}' provided. Valid values are 'alpha', 'rc', 'stable'."
exit 1
- name: Validate add tag
if: ${{ github.event.inputs.add-tag != 'false' && github.event.inputs.add-tag != 'true' }}
run: |
echo "Invalid add tag '${{ github.event.inputs.add-tag }}' provided. Valid values are 'true', 'false'."
exit 1
- name: Checkout branch
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -54,3 +64,10 @@ jobs:
with:
name: ${{ env.TEMPLATE_NAME }}
path: template.zip

- name: Release template ZIP file To GitHub Release
uses: softprops/action-gh-release@v2
if: ${{ github.event.inputs.add-tag == 'true' }}
with:
tag_name: ${{ env.TIMESTAMP }}-${{ inputs.publish-branch }}-${{ inputs.release-type }}
files: template.zip

0 comments on commit 413879e

Please sign in to comment.