Skip to content

Test

Test #58

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 original 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/')
# Customize image
customize-image:
name: Customize image
# needs: [release, download]
needs: [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 ${{ env.IMAGE_FILENAME }}
# run: ./customize.sh ${{ matrix.variant }}
- 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
upload-image:
name: Upload image artifact
needs: [release, customize-image]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load settings
run: source settings.sh