-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
67 lines (62 loc) · 2.01 KB
/
vagrant.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
60
61
62
63
64
65
66
67
name: Vagrant
on:
push:
branches:
- master
- dev
- 'dev/**'
paths:
- '.github/workflows/vagrant.yml'
- 'scripts/Vagrantfile'
pull_request:
paths:
- '.github/workflows/vagrant.yml'
- 'scripts/Vagrantfile'
schedule:
# approx biweekly
- cron: '0 0 7,28 * *'
workflow_dispatch:
permissions: {} # none
jobs:
build:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Vagrant repo
run: |
# https://developer.hashicorp.com/vagrant/downloads#linux
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
- name: Install packages
run: |
sudo apt update
sudo apt install -y vagrant virtualbox
- name: Install vagrant-disksize plugin
run: vagrant plugin install vagrant-disksize
- name: Run "vagrant up" in scripts directory
run: |
cd scripts
vagrant up
- name: Test build coreutils
run: |
cd scripts
vagrant ssh -c "cd ~/termux-packages; ./build-package.sh coreutils"
- name: Generate build artifacts
run: |
if [[ -z "$(find output -type f)" ]]; then
echo "ERROR: No files found in output dir" 1>&2
exit 1
fi
mkdir -p artifacts debs
find output -name "*.deb" -type f -print0 | xargs -0r mv -t debs/
# Files containing certain symbols (e.g. ":") will cause failure in actions/upload-artifact.
# Archiving *.deb files in a tarball to avoid issues with uploading.
tar cf artifacts/debs-${{ github.sha }}.tar debs
- name: Store *.deb files
uses: actions/upload-artifact@v4
with:
name: debs-${{ github.sha }}
path: ./artifacts