ci: refine workflow permissions and version parsing logic (#4922)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-25 20:16:22 -05:00 committed by GitHub
parent a005231d94
commit 6f95435cfc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 39 additions and 9 deletions

View file

@ -38,14 +38,18 @@ jobs:
- name: Configure Version
id: version
env:
EVENT_NAME: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
VERSION_SUFFIX: ${{ inputs.version_suffix }}
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "VERSION_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
if [[ "$EVENT_NAME" == "release" ]]; then
echo "VERSION_NAME=$RELEASE_TAG" >> $GITHUB_ENV
else
# Use a timestamp-based version for manual/branch builds to avoid collisions
# or use the base version + suffix
BASE_VERSION=$(grep "VERSION_NAME_BASE" config.properties | cut -d'=' -f2)
echo "VERSION_NAME=${BASE_VERSION}${{ inputs.version_suffix }}" >> $GITHUB_ENV
echo "VERSION_NAME=${BASE_VERSION}${VERSION_SUFFIX}" >> $GITHUB_ENV
fi
- name: Publish to GitHub Packages