fix(ci): Use explicit version input for C3Box VM naming
- Add 'version' input parameter (default: v1.0.0-beta)
- Use C3BOX_VERSION env var for consistent naming
- Artifacts now named: c3box-vm-{version}-{arch}.{format}
- Fix: manual triggers now use correct version in filenames
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5da21f29e4
commit
2482f76e52
21
.github/workflows/build-vm-appliance.yml
vendored
21
.github/workflows/build-vm-appliance.yml
vendored
@ -5,6 +5,11 @@ name: Build C3Box VM Appliance
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version tag (e.g. v1.0.0-beta)'
|
||||||
|
required: true
|
||||||
|
default: 'v1.0.0-beta'
|
||||||
|
type: string
|
||||||
openwrt_version:
|
openwrt_version:
|
||||||
description: 'OpenWrt version'
|
description: 'OpenWrt version'
|
||||||
required: true
|
required: true
|
||||||
@ -43,6 +48,7 @@ on:
|
|||||||
env:
|
env:
|
||||||
OPENWRT_VERSION: ${{ github.event.inputs.openwrt_version || '24.10.5' }}
|
OPENWRT_VERSION: ${{ github.event.inputs.openwrt_version || '24.10.5' }}
|
||||||
DISK_SIZE: ${{ github.event.inputs.disk_size || '2' }}
|
DISK_SIZE: ${{ github.event.inputs.disk_size || '2' }}
|
||||||
|
C3BOX_VERSION: ${{ github.event.inputs.version || github.ref_name }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -181,7 +187,7 @@ jobs:
|
|||||||
|
|
||||||
# C3Box release info
|
# C3Box release info
|
||||||
cat > imagebuilder/files/etc/c3box/release << EOF
|
cat > imagebuilder/files/etc/c3box/release << EOF
|
||||||
C3BOX_VERSION="${{ github.ref_name || 'dev' }}"
|
C3BOX_VERSION="${{ env.C3BOX_VERSION }}"
|
||||||
C3BOX_BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
C3BOX_BUILD_DATE="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||||
OPENWRT_VERSION="${{ env.OPENWRT_VERSION }}"
|
OPENWRT_VERSION="${{ env.OPENWRT_VERSION }}"
|
||||||
VM_TYPE="${{ matrix.boot }}"
|
VM_TYPE="${{ matrix.boot }}"
|
||||||
@ -310,10 +316,9 @@ jobs:
|
|||||||
truncate -s ${TARGET_BYTES} /tmp/openwrt.img
|
truncate -s ${TARGET_BYTES} /tmp/openwrt.img
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Base filename
|
# Base filename - use version input or tag name
|
||||||
VERSION="${{ env.OPENWRT_VERSION }}"
|
VERSION="${{ env.C3BOX_VERSION }}"
|
||||||
TAG="${{ github.ref_name }}"
|
BASENAME="c3box-vm-${VERSION}-${{ matrix.name }}"
|
||||||
BASENAME="c3box-vm-${TAG:-dev}-${{ matrix.name }}"
|
|
||||||
|
|
||||||
# Convert to VMDK (VMware)
|
# Convert to VMDK (VMware)
|
||||||
echo "🔄 Creating VMDK (VMware)..."
|
echo "🔄 Creating VMDK (VMware)..."
|
||||||
@ -344,8 +349,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Create documentation
|
- name: Create documentation
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.ref_name }}"
|
VERSION="${{ env.C3BOX_VERSION }}"
|
||||||
BASENAME="c3box-vm-${TAG:-dev}-${{ matrix.name }}"
|
BASENAME="c3box-vm-${VERSION}-${{ matrix.name }}"
|
||||||
|
|
||||||
cat > artifacts/README.md << EOF
|
cat > artifacts/README.md << EOF
|
||||||
# C3Box VM Appliance - ${{ matrix.description }}
|
# C3Box VM Appliance - ${{ matrix.description }}
|
||||||
@ -427,7 +432,7 @@ jobs:
|
|||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: c3box-vm-${{ matrix.name }}-${{ env.OPENWRT_VERSION }}
|
name: c3box-vm-${{ env.C3BOX_VERSION }}-${{ matrix.name }}
|
||||||
path: artifacts/
|
path: artifacts/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user