mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
ci: add GitLab Release job on tags and attach ISO artifact; expose artifacts/local in build
This commit is contained in:
parent
adf1de6747
commit
191cfd2f5c
1 changed files with 37 additions and 14 deletions
|
|
@ -6,12 +6,13 @@ build_iso:
|
|||
stage: build
|
||||
image: ubuntu:24.04
|
||||
timeout: 90 minutes
|
||||
only:
|
||||
- main
|
||||
- tags
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
artifacts:
|
||||
paths:
|
||||
- aethex-linux-build/
|
||||
- artifacts/local/
|
||||
expire_in: 90 days
|
||||
script:
|
||||
# Update system
|
||||
|
|
@ -33,23 +34,45 @@ build_iso:
|
|||
|
||||
# Verify ISO exists
|
||||
- |
|
||||
if ls aethex-linux-build/AeThex-Linux-*.iso 1> /dev/null 2>&1; then
|
||||
echo "✅ ISO built successfully"
|
||||
ls -lh aethex-linux-build/AeThex-Linux-*.iso
|
||||
sha256sum aethex-linux-build/AeThex-Linux-*.iso > aethex-linux-build/SHA256
|
||||
ISO_PATH=$(ls aethex-linux-build/AeThex-Linux-*.iso 2>/dev/null | head -n 1)
|
||||
if [ -n "$ISO_PATH" ]; then
|
||||
echo "✅ ISO built successfully: $ISO_PATH"
|
||||
ls -lh "$ISO_PATH"
|
||||
sha256sum "$ISO_PATH" > aethex-linux-build/SHA256
|
||||
mkdir -p artifacts/local
|
||||
cp "$ISO_PATH" artifacts/local/
|
||||
cp aethex-linux-build/SHA256 artifacts/local/$(basename "$ISO_PATH").sha256
|
||||
else
|
||||
echo "⚠️ ISO not found, continuing anyway"
|
||||
fi
|
||||
|
||||
release_iso:
|
||||
stage: release
|
||||
image: curlimages/curl:latest
|
||||
only:
|
||||
- tags
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
needs:
|
||||
- job: build_iso
|
||||
artifacts: true
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
variables:
|
||||
RELEASE_NAME: "AeThex OS $CI_COMMIT_TAG"
|
||||
script:
|
||||
# Upload to GitHub Release (requires GITHUB_TOKEN)
|
||||
- echo "Creating GitLab release for tag $CI_COMMIT_TAG"
|
||||
- |
|
||||
if [ -f aethex-linux-build/AeThex-Linux-*.iso ]; then
|
||||
echo "Uploading ISO to GitHub Release..."
|
||||
# This would upload to GitHub using the token
|
||||
ISO_PATH=$(ls artifacts/local/AeThex-Linux-*.iso 2>/dev/null | head -n 1)
|
||||
if [ -z "$ISO_PATH" ]; then
|
||||
echo "No ISO found in artifacts/local. Listing..." && ls -la artifacts/local || true
|
||||
fi
|
||||
- |
|
||||
if [ -n "$ISO_PATH" ]; then
|
||||
# Create release and attach asset link pointing to job artifact (90-day retention)
|
||||
release-cli create \
|
||||
--name "$RELEASE_NAME" \
|
||||
--tag-name "$CI_COMMIT_TAG" \
|
||||
--assets-link name="AeThex OS ISO" url="$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/$ISO_PATH"
|
||||
else
|
||||
# Create release without asset if ISO missing
|
||||
release-cli create \
|
||||
--name "$RELEASE_NAME" \
|
||||
--tag-name "$CI_COMMIT_TAG"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue