Skip to content

Commit

Permalink
feat: uploading qcow image to GitHub releases as an asset (#210)
Browse files Browse the repository at this point in the history
* feat: uploading qcow image to github releases as an asset.

* feat: adding the ability to run qmeu manually and specify a tag/version

* fix: missed inputs.glueops_codespace_tag

* feat: increasing cores + threads to leverage higher performance runner

* fix: cores and memory allocation

* revert: threads/cores/cpu/memory changes
  • Loading branch information
venkatamutyala authored Nov 25, 2024
1 parent 0887a04 commit badc523
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
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



2 changes: 1 addition & 1 deletion qemu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ packer {
version = "1.1.0"
}
}
}
}

0 comments on commit badc523

Please sign in to comment.