Skip to content

Commit de3e7a3

Browse files
committed
Add current APP_VERSION env variable
1 parent 72fe691 commit de3e7a3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/pr-build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches: ["main"]
66

7+
env:
8+
APP_VERSION: "" # Define a default value for global accessibility
9+
710
jobs:
811
check-version:
912
runs-on: ubuntu-latest
@@ -25,7 +28,7 @@ jobs:
2528
- name: Check version in ver.py
2629
id: check-version
2730
run: |
28-
CURRENT_VERSION=$(cat ver.py | grep -o "'.*'")
31+
CURRENT_VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'")
2932
echo "Current version is $CURRENT_VERSION"
3033
3134
if [ "$CURRENT_VERSION" == "$LATEST_TAG" ]; then
@@ -35,8 +38,9 @@ jobs:
3538
else
3639
echo "Current version $CURRENT_VERSION differs from latest tag $LATEST_TAG. Build will continue."
3740
echo "::set-output name=should-run::true"
41+
echo "APP_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
3842
fi
39-
echo "APP_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT
43+
4044
build:
4145
needs: check-version
4246
if: needs.check-version.outputs.should-run == 'true'
@@ -107,7 +111,7 @@ jobs:
107111
- name: Save build artifacts
108112
uses: actions/upload-artifact@v3
109113
with:
110-
name: ${{ matrix.name }}-build-${{ github.event.pull_request.number }}-${{ github.sha }}
114+
name: ${{ matrix.name }}-build-${{ env.APP_VERSION }}-${{ github.event.pull_request.number }}-${{ github.sha }}
111115
path: dist/*
112116

113117
collect-artifacts:

0 commit comments

Comments
 (0)