Skip to content

chore: release 0.20240816.0 #14

chore: release 0.20240816.0

chore: release 0.20240816.0 #14

Workflow file for this run

name: Build a release
# Source: https://github.com/jonashackt/vagrant-github-actions
on:
push:
branches:
- main
paths:
- 'version.txt'
workflow_dispatch:
jobs:
build-release:
runs-on: ubuntu-22.04
steps:
- name: Install Vagrant and Virtualbox
run: |
sudo apt update && sudo apt install virtualbox
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Vagrant boxes
uses: actions/cache@v4
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('Vagrantfile') }}
restore-keys: |
${{ runner.os }}-vagrant-
- name: Show Vagrant version
run: vagrant --version
- name: Show VirtualBox version
run: VBoxManage --version
- name: Build the environment
run: vagrant up
- name: Create a Vagrant box
run: vagrant package --vagrantfile Vagrantfile-in-box --output ipv6-security-lab-$(cat version.txt).box
- name: Store box file
uses: actions/upload-artifact@v4
with:
name: vagrant-box
path: "ipv6-security-lab-*.box"
- name: Publish box file in the release
if: startsWith(github.ref, 'refs/tags/')
uses: djn24/add-asset-to-release@v2
continue-on-error: true
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: "ipv6-security-lab-*.box"
- name: Publish box file in the Vagrant Cloud
env:
ATLAS_TOKEN: ${{ secrets.VAGRANT_CLOUD_TOKEN }}
run: vagrant cloud publish ripencc/ipv6seclab $(cat version.txt) virtualbox ipv6-security-lab-$(cat version.txt).box --force