Skip to content

Test

Test #56

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
tags:
- v*
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
# Release
release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release draft
uses: ./.github/actions/create-release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
# Download
download:
name: Download image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load settings
run: source settings.sh
- id: cache
name: Cache
uses: ./.github/actions/smart-cache
- name: Download origianl image
run: wget "$DEBIAN_FILEURL"
if: steps.cache.outputs.cache-hit != 'true'
- name: Upload original image artifact
run: gh release upload "${GITHUB_REF_NAME}" *.qcow2
if: startsWith(github.ref, 'refs/tags/')
# Rebuild images
rebuild-images:
name: Rebuild image
needs: [release, download]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load settings
run: source settings.sh
- name: Cache
uses: ./.github/actions/smart-cache
- name: Install libguestfs
run: |
sudo apt-get update -y
# sudo apt-get install -y libguestfs-tools
- name: Rebuild image
run: ./customize.sh qemu
# run: ./customize.sh ${{ matrix.variant }}
# run: |
# # Install packages
# declare -A packages
# packages=(
# [qemu]=qemu-guest-agent
# [locales]=qemu-guest-agent,locales-all
# [extras]=qemu-guest-agent,locales-all,htop
# )
# sudo virt-customize -a *.qcow2 \
# --install ${packages[${{ matrix.variant }}]} \
# --run-command "apt-get clean"
- name: Compress image artifact
run: |
# Compress image
# SOURCE_FILE="$(ls *.qcow2)"
# TARGET_FILE="${SOURCE_FILE/genericcloud/${{ matrix.variant }}}"
# sudo virt-sparsify ${SOURCE_FILE} --compress ${TARGET_FILE}
# sudo rm ${SOURCE_FILE}
# - name: Upload custom image artifact
# run: gh release upload "${GITHUB_REF_NAME}" *.qcow2
- run: echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY