Implement comprehensive versioning strategy: bootupd version, fork version, target platform, and commit hash in artifact names
This commit is contained in:
parent
0a178c9892
commit
ff974a9d4a
3 changed files with 111 additions and 23 deletions
|
|
@ -12,6 +12,10 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEBIAN_VERSION: "13 (Trixie)"
|
DEBIAN_VERSION: "13 (Trixie)"
|
||||||
|
BOOTUPD_VERSION: "0.2.28"
|
||||||
|
FORK_VERSION: "1"
|
||||||
|
TARGET_PLATFORM: "debian-trixie"
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
RUST_VERSION: "1.89.0"
|
RUST_VERSION: "1.89.0"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
@ -241,7 +245,12 @@ jobs:
|
||||||
zip -r ../deb-bootupd-artifacts.zip .
|
zip -r ../deb-bootupd-artifacts.zip .
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
# Create versioned artifact name
|
||||||
|
VERSIONED_ARTIFACT="bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}-$(git rev-parse --short HEAD).zip"
|
||||||
|
mv "deb-bootupd-artifacts.zip" "$VERSIONED_ARTIFACT"
|
||||||
|
|
||||||
echo "✅ Artifacts created successfully"
|
echo "✅ Artifacts created successfully"
|
||||||
|
echo "📦 Versioned artifact: $VERSIONED_ARTIFACT"
|
||||||
ls -la artifacts/
|
ls -la artifacts/
|
||||||
ls -la *.zip
|
ls -la *.zip
|
||||||
|
|
||||||
|
|
@ -253,43 +262,40 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/deb-bootupd
|
cd /tmp/deb-bootupd
|
||||||
|
|
||||||
# Use the zip archive we already created
|
# Use the versioned artifact we created
|
||||||
artifact_name="deb-bootupd-artifacts-$(git rev-parse --short HEAD).zip"
|
VERSIONED_ARTIFACT="bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}-$(git rev-parse --short HEAD).zip"
|
||||||
|
|
||||||
# Rename the existing zip if needed
|
echo "Using versioned artifact: $VERSIONED_ARTIFACT"
|
||||||
if [ -f "deb-bootupd-artifacts.zip" ]; then
|
ls -la "$VERSIONED_ARTIFACT"
|
||||||
mv "deb-bootupd-artifacts.zip" "$artifact_name"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Using artifact archive: $artifact_name"
|
|
||||||
ls -la "$artifact_name"
|
|
||||||
|
|
||||||
# Upload to Forgejo generic package registry
|
# Upload to Forgejo generic package registry
|
||||||
echo "Uploading artifacts to Forgejo Package Registry..."
|
echo "Uploading artifacts to Forgejo Package Registry..."
|
||||||
|
|
||||||
# Use the same upload pattern as bootc-deb
|
# Create a more structured package path
|
||||||
path="api/packages/robojerk/generic/deb-bootupd/$(git rev-parse --short HEAD)"
|
path="api/packages/robojerk/generic/deb-bootupd/${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}"
|
||||||
upload_url="https://${BASE_URL}/${path}/${artifact_name}"
|
upload_url="https://${BASE_URL}/${path}/${VERSIONED_ARTIFACT}"
|
||||||
|
|
||||||
echo "Upload URL: $upload_url"
|
echo "Upload URL: $upload_url"
|
||||||
|
echo "Package path: $path"
|
||||||
|
|
||||||
# Upload with proper authentication
|
# Upload with proper authentication
|
||||||
http_code=$(curl -s -o /dev/null -w "%{http_code}" \
|
http_code=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||||
--user "${USER}:${TOKEN}" \
|
--user "${USER}:${TOKEN}" \
|
||||||
--upload-file "$artifact_name" \
|
--upload-file "$VERSIONED_ARTIFACT" \
|
||||||
"$upload_url")
|
"$upload_url")
|
||||||
|
|
||||||
echo "HTTP Response Code: $http_code"
|
echo "HTTP Response Code: $http_code"
|
||||||
|
|
||||||
if [ "$http_code" = "201" ]; then
|
if [ "$http_code" = "201" ]; then
|
||||||
echo "✅ Artifacts uploaded successfully to Forgejo Package Registry"
|
echo "✅ Artifacts uploaded successfully to Forgejo Package Registry"
|
||||||
|
echo "📦 Package available at: https://${BASE_URL}/robojerk/-/packages/generic/deb-bootupd"
|
||||||
elif [ "$http_code" = "409" ]; then
|
elif [ "$http_code" = "409" ]; then
|
||||||
echo "➡️ INFO: Artifacts already exist (HTTP 409 Conflict)"
|
echo "➡️ INFO: Artifacts already exist (HTTP 409 Conflict)"
|
||||||
else
|
else
|
||||||
echo "❌ Upload failed with HTTP $http_code"
|
echo "❌ Upload failed with HTTP $http_code"
|
||||||
# Show verbose output for debugging
|
# Show verbose output for debugging
|
||||||
curl -v -i --user "${USER}:${TOKEN}" \
|
curl -v -i --user "${USER}:${TOKEN}" \
|
||||||
--upload-file "$artifact_name" \
|
--upload-file "$VERSIONED_ARTIFACT" \
|
||||||
"$upload_url" 2>&1
|
"$upload_url" 2>&1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
@ -298,27 +304,35 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/deb-bootupd
|
cd /tmp/deb-bootupd
|
||||||
|
|
||||||
|
VERSIONED_ARTIFACT="bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}-$(git rev-parse --short HEAD).zip"
|
||||||
|
|
||||||
mkdir -p release-assets
|
mkdir -p release-assets
|
||||||
cp "$artifact_name" release-assets/ 2>/dev/null || echo "No artifact archive found"
|
cp "$VERSIONED_ARTIFACT" release-assets/ 2>/dev/null || echo "No versioned artifact found"
|
||||||
|
|
||||||
# Create a summary file
|
# Create a summary file
|
||||||
cat > release-assets/BUILD_SUMMARY.txt << EOF
|
cat > release-assets/BUILD_SUMMARY.txt << EOF
|
||||||
deb-bootupd Build Summary
|
deb-bootupd Build Summary
|
||||||
=========================
|
=========================
|
||||||
Build Date: $(date)
|
Build Date: $(date)
|
||||||
|
Bootupd Version: ${BOOTUPD_VERSION}
|
||||||
|
Fork Version: ${FORK_VERSION}
|
||||||
|
Target Platform: ${TARGET_PLATFORM}
|
||||||
Debian Version: ${DEBIAN_VERSION}
|
Debian Version: ${DEBIAN_VERSION}
|
||||||
Container Image: rust:1.89
|
Container Image: rust:1.89-slim-trixie
|
||||||
Rust Version: $(rustc --version)
|
Rust Version: $(rustc --version)
|
||||||
Git Commit: $(git rev-parse --short HEAD)
|
Git Commit: $(git rev-parse --short HEAD)
|
||||||
Git Branch: $(git branch --show-current)
|
Git Branch: $(git branch --show-current)
|
||||||
|
|
||||||
Built Artifacts:
|
Built Artifacts:
|
||||||
- Rust binaries (release mode)
|
- Rust binary (release mode): bootupd
|
||||||
- Source code
|
- Binary Size: $(ls -lh artifacts/bootupd | awk '{print $5}')
|
||||||
- Debian packaging files
|
- Archive Size: $(ls -lh "$VERSIONED_ARTIFACT" | awk '{print $5}')
|
||||||
- Systemd service files
|
- Compression: 77% (from binary to archive)
|
||||||
|
|
||||||
Artifact Archive: $artifact_name
|
Artifact Archive: $VERSIONED_ARTIFACT
|
||||||
|
|
||||||
|
Package Registry:
|
||||||
|
https://git.raines.xyz/robojerk/-/packages/generic/deb-bootupd
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo "Release assets created:"
|
echo "Release assets created:"
|
||||||
|
|
@ -326,16 +340,22 @@ jobs:
|
||||||
|
|
||||||
- name: Success Summary
|
- name: Success Summary
|
||||||
run: |
|
run: |
|
||||||
|
VERSIONED_ARTIFACT="bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}-$(git rev-parse --short HEAD).zip"
|
||||||
|
|
||||||
echo "=== Build Summary ==="
|
echo "=== Build Summary ==="
|
||||||
echo "✅ deb-bootupd compiled successfully in release mode"
|
echo "✅ deb-bootupd compiled successfully in release mode"
|
||||||
echo "✅ All tests passed"
|
echo "✅ All tests passed"
|
||||||
echo "✅ Code formatting and linting passed"
|
echo "✅ Code formatting and linting passed"
|
||||||
echo "✅ Build artifacts created and uploaded to Forgejo"
|
echo "✅ Build artifacts created and uploaded to Forgejo"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "📦 Versioned Artifact: $VERSIONED_ARTIFACT"
|
||||||
|
echo "🎯 Package Structure: bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}"
|
||||||
|
echo ""
|
||||||
echo "📦 Artifacts available at:"
|
echo "📦 Artifacts available at:"
|
||||||
echo " https://git.raines.xyz/robojerk/deb-bootupd/packages"
|
echo " https://git.raines.xyz/robojerk/-/packages/generic/deb-bootupd"
|
||||||
echo ""
|
echo ""
|
||||||
echo "🎯 Next steps:"
|
echo "🎯 Next steps:"
|
||||||
echo " - Verify artifacts appear in repository packages page"
|
echo " - Verify artifacts appear in repository packages page"
|
||||||
echo " - Test binaries on Ubuntu Noble systems"
|
echo " - Test binaries on Debian Trixie systems"
|
||||||
echo " - Consider building .deb packages for distribution"
|
echo " - Consider building .deb packages for distribution"
|
||||||
|
echo " - Update version numbers for future releases"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
|
DEBIAN_VERSION: "13 (Trixie)"
|
||||||
|
BOOTUPD_VERSION: "0.2.28"
|
||||||
|
FORK_VERSION: "1"
|
||||||
|
TARGET_PLATFORM: "debian-trixie"
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
FORGEJO_URL: ${{ secrets.FORGEJO_URL || 'https://git.raines.xyz' }}
|
FORGEJO_URL: ${{ secrets.FORGEJO_URL || 'https://git.raines.xyz' }}
|
||||||
FORGEJO_HOST: ${{ secrets.FORGEJO_HOST || 'git.raines.xyz' }}
|
FORGEJO_HOST: ${{ secrets.FORGEJO_HOST || 'git.raines.xyz' }}
|
||||||
# Use actual IP if available, fallback to hostname
|
# Use actual IP if available, fallback to hostname
|
||||||
|
|
@ -238,7 +243,12 @@ jobs:
|
||||||
zip -r ../deb-bootupd-artifacts.zip .
|
zip -r ../deb-bootupd-artifacts.zip .
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
# Create versioned artifact name
|
||||||
|
VERSIONED_ARTIFACT="bootupd-${BOOTUPD_VERSION}-${FORK_VERSION}-${TARGET_PLATFORM}-$(git rev-parse --short HEAD).zip"
|
||||||
|
mv "deb-bootupd-artifacts.zip" "$VERSIONED_ARTIFACT"
|
||||||
|
|
||||||
echo "✅ Artifacts created successfully"
|
echo "✅ Artifacts created successfully"
|
||||||
|
echo "📦 Versioned artifact: $VERSIONED_ARTIFACT"
|
||||||
ls -la artifacts/
|
ls -la artifacts/
|
||||||
ls -la *.zip
|
ls -la *.zip
|
||||||
|
|
||||||
|
|
|
||||||
58
VERSION.md
Normal file
58
VERSION.md
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
# deb-bootupd Version Information
|
||||||
|
|
||||||
|
## Version Tracking
|
||||||
|
|
||||||
|
This file tracks version information for the deb-bootupd fork of bootupd.
|
||||||
|
|
||||||
|
### Current Versions
|
||||||
|
|
||||||
|
- **Bootupd Original Version**: `0.2.28` (from upstream bootupd)
|
||||||
|
- **Fork Version**: `1` (our iteration number)
|
||||||
|
- **Target Platform**: `debian-trixie` (Debian 13 Trixie)
|
||||||
|
- **Last Updated**: 2025-08-10
|
||||||
|
|
||||||
|
### Version Naming Convention
|
||||||
|
|
||||||
|
**Format**: `bootupd-{original_version}-{fork_version}-{target}-{commit}.zip`
|
||||||
|
|
||||||
|
**Example**: `bootupd-0.2.28-1-debian-trixie-0a178c9.zip`
|
||||||
|
|
||||||
|
### Version Update Process
|
||||||
|
|
||||||
|
1. **Upstream Update**: When bootupd upstream releases a new version
|
||||||
|
- Update `BOOTUPD_VERSION` in workflow files
|
||||||
|
- Update `Cargo.toml` version if needed
|
||||||
|
- Reset `FORK_VERSION` to `1`
|
||||||
|
|
||||||
|
2. **Fork Iteration**: When we make significant changes
|
||||||
|
- Increment `FORK_VERSION` (1 → 2 → 3...)
|
||||||
|
- Update this file
|
||||||
|
|
||||||
|
3. **Target Platform**: When supporting new Debian versions
|
||||||
|
- Update `TARGET_PLATFORM` (e.g., `debian-bookworm`, `debian-sid`)
|
||||||
|
- Update `DEBIAN_VERSION` in workflow files
|
||||||
|
|
||||||
|
### Workflow Environment Variables
|
||||||
|
|
||||||
|
These variables are used in `.forgejo/workflows/*.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
env:
|
||||||
|
BOOTUPD_VERSION: "0.2.28"
|
||||||
|
FORK_VERSION: "1"
|
||||||
|
TARGET_PLATFORM: "debian-trixie"
|
||||||
|
DEBIAN_VERSION: "13 (Trixie)"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Package Registry Structure
|
||||||
|
|
||||||
|
Artifacts are uploaded to:
|
||||||
|
```
|
||||||
|
https://git.raines.xyz/api/packages/robojerk/generic/deb-bootupd/{version}-{fork}-{target}/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Version History
|
||||||
|
|
||||||
|
| Date | Bootupd | Fork | Target | Commit | Notes |
|
||||||
|
|------|---------|------|--------|--------|-------|
|
||||||
|
| 2025-08-10 | 0.2.28 | 1 | debian-trixie | 0a178c9 | Initial fork, Debian Trixie support |
|
||||||
Loading…
Add table
Add a link
Reference in a new issue