mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
ci(workflow): Improve release tag detection and artifact changelog (#3954)
This commit is contained in:
parent
34225cdfe3
commit
b1c580c626
1 changed files with 27 additions and 3 deletions
30
.github/workflows/main-push-changelog.yml
vendored
30
.github/workflows/main-push-changelog.yml
vendored
|
|
@ -22,8 +22,18 @@ jobs:
|
|||
- name: Determine last production tag
|
||||
id: last_prod_tag
|
||||
run: |
|
||||
# Find the most recent tag that looks like a production release (vX.Y.Z)
|
||||
TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-creatordate | head -n 1)
|
||||
# Find the highest semantic version tag of the form vX.Y.Z
|
||||
# and ignore any tags with suffixes like -track.N, -rc.N, etc.
|
||||
TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' \
|
||||
| grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
|
||||
| sed 's/^v//' \
|
||||
| sort -V \
|
||||
| tail -n 1)
|
||||
|
||||
if [ -n "$TAG" ]; then
|
||||
TAG="v$TAG"
|
||||
fi
|
||||
|
||||
echo "Found last production tag: $TAG"
|
||||
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
|
@ -38,6 +48,21 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Save changelog to file
|
||||
if: steps.last_prod_tag.outputs.tag != ''
|
||||
run: |
|
||||
mkdir -p artifacts
|
||||
cat << 'EOF' > artifacts/main-push-changelog.md
|
||||
${{ steps.changelog.outputs.changelog }}
|
||||
EOF
|
||||
|
||||
- name: Upload changelog artifact
|
||||
if: steps.last_prod_tag.outputs.tag != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: main-push-changelog
|
||||
path: artifacts/main-push-changelog.md
|
||||
|
||||
- name: Print main push summary
|
||||
run: |
|
||||
echo "Pushed to main"
|
||||
|
|
@ -52,4 +77,3 @@ jobs:
|
|||
else
|
||||
echo "No production tag (vX.Y.Z) found. Skipping changelog generation."
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue