Skip to content

Commit 3ff453b

Browse files
🔧 Update script file with required functions
1 parent 9061f0b commit 3ff453b

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/scripts/release/setup-release-vars.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
set -e
66

77
# Determine version and release type
8-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
9-
VERSION="${{ github.event.inputs.version }}"
10-
RELEASE_TYPE="${{ github.event.inputs.release_type }}"
11-
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref_type }}" == "tag" ]]; then
12-
VERSION="${{ github.ref_name }}"
8+
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
9+
VERSION="$INPUT_VERSION"
10+
elif [[ "$EVENT_NAME" == "push" && "$REF_TYPE" == "tag" ]]; then
11+
VERSION="$REF_NAME"
1312
VERSION="${VERSION#v}"
14-
if [[ "$VERSION" == *"-rc"* ]]; then
15-
RELEASE_TYPE="rc"
16-
else
17-
RELEASE_TYPE="stable"
18-
fi
13+
fi
14+
15+
# Determine release type based on version string
16+
if [[ "$VERSION" == *"-rc"* ]]; then
17+
RELEASE_TYPE="rc"
18+
else
19+
RELEASE_TYPE="stable"
1920
fi
2021

2122
# Validate version format

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
run: |
3232
chmod +x .github/scripts/release/*.sh
3333
.github/scripts/release/setup-release-vars.sh
34+
env:
35+
EVENT_NAME: ${{ github.event_name }}
36+
INPUT_VERSION: ${{ github.event.inputs.version }}
37+
REF_TYPE: ${{ github.ref_type }}
38+
REF_NAME: ${{ github.ref_name }}
3439

3540
- name: Build
3641
run: .github/scripts/release/build-and-test.sh

0 commit comments

Comments
 (0)