Skip to content

Merge remote-tracking branch 'ibex/main' #132

Merge remote-tracking branch 'ibex/main'

Merge remote-tracking branch 'ibex/main' #132

Workflow file for this run

name: vm-provision
on:
push:
branches:
- main
- 'testing/**'
- 'feature/**'
- 'hotfix/**'
# Run pipeline for release tags
tags:
- 'v*.*.*'
schedule:
# Weekly builds on Monday morning 7:05
# Github doc:
# "The schedule event can be delayed during periods of high loads of GitHub Actions workflow runs.
# High load times include the start of every hour.
# To decrease the chance of delay, schedule your workflow to run at a different time of the hour."
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '5 7 * * 1'
jobs:
vagrant-provision:
# Running on self-hosted system(s), because GitHub-hosted action runners did break too often.
# https://github.com/actions/runner-images/issues/433
runs-on:
group: Default
labels: [self-hosted, Linux, X64]
steps:
- name: clean up old VirtualBox VMs
run: |
vboxmanage list vms | \
grep -o -P '(?<={).*(?=})' | \
while read line ; do vboxmanage unregistervm $line --delete ; done
- name: clean up old Vagrant artifacts
run: |
vagrant destroy gips || true
vagrant box remove gusztavvargadr/xubuntu-desktop-2404-lts || true
# https://stackoverflow.com/a/71346341
- name: clean up old GitHub Actions runner build folder
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v4
- name: show Vagrant version
run: vagrant --version
- name: run vagrant up
run: |
vagrant up
echo "=> Vagrant run finished."
env:
GITHUB_TOKEN: ${{ github.token }}
- name: export VirtualBox VM
run: |
vagrant halt
vboxmanage export gips -o gips.ovf
sed -i -e '/<BIOS>/,/<\/BIOS>/d' gips.ovf
sed -i -e '/<RemoteDisplay enabled="true">/,/<\/RemoteDisplay>/d' gips.ovf
tar -cvf gips.ova gips.ovf gips-disk001.vmdk
rm -rf gips.ovf gips-disk001.vmdk
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: gips-ova
path: gips.ova
# Create a release if running on tag
create-release:
needs: [vagrant-provision]
runs-on: ubuntu-20.04
# Only run on pushed tags (and explicitely ignore scheduled runs)
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.event_name != 'schedule'
steps:
- name: collect artifacts
uses: actions/download-artifact@v4
- name: create splitted ZIP archive
run: |
sudo apt-get install -yq zip
zip -r -s 1990m gips-vm.zip gips-ova/gips.ova
# Due to a bug in the release action, we have to upload all artifacts step-by-step
# https://github.com/softprops/action-gh-release/issues/243
- name: release gips-vm (1)
uses: softprops/action-gh-release@v2
with:
body: "The VM archive can not be directly added to this release because of the size limitation of 2GB per file. Please download the splitted ZIP archive and extract it manually."
files: gips-vm.zip
- name: release gips-vm (2)
uses: softprops/action-gh-release@v2
with:
body: "The VM archive can not be directly added to this release because of the size limitation of 2GB per file. Please download the splitted ZIP archive and extract it manually."
files: gips-vm.z01
- name: release gips-vm (3)
uses: softprops/action-gh-release@v2
with:
body: "The VM archive can not be directly added to this release because of the size limitation of 2GB per file. Please download the splitted ZIP archive and extract it manually."
files: gips-vm.z02
- name: release gips-vm (4)
uses: softprops/action-gh-release@v2
with:
body: "The VM archive can not be directly added to this release because of the size limitation of 2GB per file. Please download the splitted ZIP archive and extract it manually."
files: gips-vm.z03