Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: uploading qcow image to GitHub releases as an asset #210

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/packer-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
workflows: ["Build and Publish devcontainer image"]
types:
- completed
workflow_dispatch:
inputs:
glueops_codespace_tag:
description: 'Enter the Codespace tag name e.g. v0.60.0'
required: false

jobs:
build:
Expand Down Expand Up @@ -40,7 +45,7 @@ jobs:

- name: Run packer build
id: build
run: packer build -var glueops_codespaces_container_tag=${{ github.event.workflow_run.head_branch }} qemu.pkr.hcl
run: packer build -var glueops_codespaces_container_tag=${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }} qemu.pkr.hcl

- id: install-aws-cli
uses: unfor19/install-aws-cli-action@v1
Expand All @@ -49,12 +54,18 @@ jobs:
verbose: false
arch: amd64

- name: copy file to s3 storage
- name: Split qcow2 image into 1024M files
run: |
aws s3 cp images/${{ github.event.workflow_run.head_branch }}.qcow2 s3://${{ secrets.S3_BUCKET }}/${{ github.event.workflow_run.head_branch }}.qcow2
mv images/${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2 ..
tar -cvf ${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2
split -b 1024M ${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2.tar ${{ inputs.glueops_codespace_tag || github.event.workflow_run.head_branch }}.qcow2.tar.part_
- name: Upload *.qcow.tar.part_* files to GitHub Releases as an Asset
uses: xresloader/upload-to-github-release@v1
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.S3_BUCKET_REGION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.qcow2.tar.part_*"
tags: true



7 changes: 4 additions & 3 deletions qemu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ source "qemu" "qemu-amd64" {
ssh_wait_timeout = "5m"
vnc_port_min = 5901
vnc_port_max = 5901
cores = 8
qemuargs = [
["-m", "4096M"],
["-smp", "2"],
["-m", "30000M"],
["-smp", "8"],
["-cdrom", "ci-data.iso"]
]
}
Expand Down Expand Up @@ -74,4 +75,4 @@ packer {
version = "1.1.0"
}
}
}
}