-
-
Notifications
You must be signed in to change notification settings - Fork 103
60 lines (51 loc) · 2.03 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Release CI
on:
push:
branches: [ "nixos-**" ]
jobs:
build:
name: Run build ${{ matrix.BUILDER }} ${{ matrix.ARCH }}
runs-on: ubuntu-latest
strategy:
matrix:
BUILDER: ['virtualbox-iso.virtualbox', 'qemu.qemu']
ARCH: ['x86_64']
steps:
- uses: actions/checkout@v3
- name: Install dependencies
if: ${{matrix.BUILDER == 'virtualbox-iso.virtualbox'}}
run: |
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
sudo apt-get update
sudo apt-get install -y virtualbox-6.1
- name: Install dependencies
if: ${{matrix.BUILDER == 'qemu.qemu'}}
run: |
sudo apt-get update
sudo apt-get install -y \
qemu-system-x86 \
qemu libvirt-daemon-system
- name: Create Vagrant Cloud Box
run: |
curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer ${{ secrets.ATLAS_TOKEN }}" \
https://app.vagrantup.com/api/v2/boxes \
--data '{ "box": { "username": "nixbox", "name": "nixos" } }'
- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
with:
version: "latest"
- name: Run build ${{ matrix.BUILDER }} ${{ matrix.ARCH }} and push box to vagrant cloud
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
run: make VERSION=${GITHUB_REF#refs/heads/nixos-} BUILDER=${{ matrix.BUILDER }} packer-build
- name: Release the Vagrant Cloud box
run: |
curl \
--request PUT \
--header "Authorization: Bearer ${{ secrets.ATLAS_TOKEN }}" \
"https://app.vagrantup.com/api/v2/box/nixbox/nixos/version/${GITHUB_REF#refs/heads/nixos-}/release"