Skip to content

Commit e2e6ac6

Browse files
committed
trigger installer action when release is released or prereleased
1 parent 22e6812 commit e2e6ac6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/v11-principal-installer-release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
name: Installer Release V11
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version_tag:
7-
description: "Version to deploy. (e.g., v11.0.0-alpha.1)"
8-
required: true
4+
release:
5+
types: ['released', 'prereleased']
96

107
jobs:
118
setup_deployment:
@@ -18,7 +15,14 @@ jobs:
1815
- name: Validate and Determine Build Environment
1916
id: set-env
2017
run: |
21-
VERSION="${{ github.event.inputs.version_tag }}"
18+
VERSION="${{ github.event.release.tag_name }}"
19+
20+
# Verify tag starts with v11.
21+
if [[ ! "$VERSION" =~ ^v11\. ]]; then
22+
echo "Skipping: This workflow only processes v11.* releases"
23+
echo "Received tag: $VERSION"
24+
exit 0
25+
fi
2226
2327
# Validate version format and determine environment
2428
if [[ "$VERSION" =~ ^v11\.[0-9]+\.[0-9]+$ ]]; then
@@ -48,7 +52,7 @@ jobs:
4852
name: Build
4953
runs-on: ubuntu-24.04
5054
needs: setup_deployment
51-
if: ${{ needs.setup_deployment.outputs.environment != '' }}
55+
if: needs.setup_deployment.outputs.environment != ''
5256
steps:
5357
- name: Check out code into the right branch
5458
uses: actions/checkout@v4
@@ -82,16 +86,12 @@ jobs:
8286
-X 'github.com/utmstack/UTMStack/installer/config.REPLACE=${{ secrets.CM_ENCRYPT_SALT }}' \
8387
-X 'github.com/utmstack/UTMStack/installer/config.PUBLIC_KEY=${{ secrets.CM_SIGN_PUBLIC_KEY }}'" .
8488
85-
- name: Create Release
86-
id: create_release
89+
- name: Upload Release Assets
8790
uses: softprops/action-gh-release@v2
8891
env:
8992
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9093
with:
91-
tag_name: ${{ needs.setup_deployment.outputs.version }}
92-
name: ${{ needs.setup_deployment.outputs.version }}
9394
body_path: ./CHANGELOG.md
9495
draft: false
95-
prerelease: ${{ needs.setup_deployment.outputs.environment != 'prod' }}
9696
files: |
9797
./installer/installer

0 commit comments

Comments
 (0)