Skip to content

Add ltrace as first glibc static tool #11

Add ltrace as first glibc static tool

Add ltrace as first glibc static tool #11

Workflow file for this run

name: Create Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag (e.g., v1.0.0)'
required: true
type: string
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Pull LFS files
run: git lfs pull
- name: Determine release tag
id: get_tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.release_tag }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Create architecture-specific zip files for tools
run: |
cd output
for arch in */; do
if [ -d "$arch" ]; then
arch_name="${arch%/}"
echo "Creating tools zip for $arch_name..."
# Check if the directory has any files
if [ "$(ls -A "$arch")" ]; then
zip -r "../stheno-toolkit-${arch_name}.zip" "$arch_name"
else
echo "Skipping empty directory: $arch_name"
fi
fi
done
cd ..
echo "Created the following tool zip files:"
ls -la stheno-toolkit-*.zip 2>/dev/null || echo "No tool zip files created!"
- name: Create preload library zip files
run: |
if [ -d "output-preload" ]; then
cd output-preload
# Create combined zip with both glibc and musl
echo "Creating combined preload libraries zip..."
zip -r "../stheno-preload-libraries-all.zip" .
# Create libc-specific zips
for libc in glibc musl; do
if [ -d "$libc" ]; then
echo "Creating $libc preload libraries zip..."
zip -r "../stheno-preload-libraries-${libc}.zip" "$libc"
fi
done
cd ..
echo "Created the following preload library zip files:"
ls -la stheno-preload-libraries-*.zip 2>/dev/null || echo "No preload library zip files created!"
else
echo "No preload libraries found to package"
fi
- name: Generate release notes
id: release_notes
run: |
TAG="${{ steps.get_tag.outputs.tag }}"
echo "## Stheno Embedded Toolkit Release $TAG" > release_notes.md
echo "" >> release_notes.md
# Get the previous tag for comparison
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
# Add what's new section
echo "### What's New" >> release_notes.md
if [ -n "$PREV_TAG" ]; then
echo "" >> release_notes.md
# Get commit messages between tags
git log --pretty=format:"- %s" $PREV_TAG..HEAD >> release_notes.md
echo "" >> release_notes.md
echo "" >> release_notes.md
# Show changed files summary
echo "### Changed Files" >> release_notes.md
echo "" >> release_notes.md
git diff --stat $PREV_TAG..HEAD | tail -n 1 >> release_notes.md
echo "" >> release_notes.md
else
echo "Initial release" >> release_notes.md
fi
echo "" >> release_notes.md
echo "### Downloads" >> release_notes.md
echo "" >> release_notes.md
echo "#### Security Tools" >> release_notes.md
echo "Download the toolkit zip file for your target architecture. All binaries are statically linked with musl libc." >> release_notes.md
echo "" >> release_notes.md
echo "#### Preload Libraries" >> release_notes.md
echo "- \`stheno-preload-libraries-all.zip\` - All preload libraries (glibc and musl)" >> release_notes.md
echo "- \`stheno-preload-libraries-glibc.zip\` - glibc-only preload libraries" >> release_notes.md
echo "- \`stheno-preload-libraries-musl.zip\` - musl-only preload libraries" >> release_notes.md
echo "" >> release_notes.md
echo "Preload libraries include: shell-env, shell-helper, shell-bind, shell-reverse, shell-fifo, and libdesock" >> release_notes.md
echo "" >> release_notes.md
echo "For a complete list of tools and supported architectures, see the [README](https://github.com/${{ github.repository }}/blob/main/README.md)." >> release_notes.md
- name: Create Release and Upload Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create the release using gh CLI
gh release create ${{ steps.get_tag.outputs.tag }} \
--title "Stheno Embedded Toolkit ${{ steps.get_tag.outputs.tag }}" \
--notes-file release_notes.md \
--repo ${{ github.repository }}
# Upload all toolkit zip files
for zip in stheno-toolkit-*.zip; do
if [ -f "$zip" ]; then
echo "Uploading $zip..."
gh release upload ${{ steps.get_tag.outputs.tag }} "$zip" \
--clobber \
--repo ${{ github.repository }}
fi
done
# Upload all preload library zip files
for zip in stheno-preload-libraries-*.zip; do
if [ -f "$zip" ]; then
echo "Uploading $zip..."
gh release upload ${{ steps.get_tag.outputs.tag }} "$zip" \
--clobber \
--repo ${{ github.repository }}
fi
done
- name: Generate SHA256 checksums
run: |
sha256sum stheno-toolkit-*.zip stheno-preload-libraries-*.zip > checksums.sha256 2>/dev/null || true
if [ -f checksums.sha256 ] && [ -s checksums.sha256 ]; then
gh release upload ${{ steps.get_tag.outputs.tag }} checksums.sha256 \
--clobber \
--repo ${{ github.repository }}
else
echo "No files to checksum"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}