-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (51 loc) · 2.29 KB
/
fade.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
name: Build Debian Package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
timeout-minutes: 1200
steps:
- uses: actions/checkout@v2
- name: Get required libraries
run: |
pip3 install -r requirements.txt
- name: Build Debian Package
run: |
sudo npm install -g typescript
COMMIT=$(git rev-parse HEAD | head -c 7)
XXXS_VERSION=$(python3 ./main.py --version)
cd /tmp; git clone https://github.com/fade-project/fade
cd fade; yarn install
yarn start --init --name xenxenxense --path $GITHUB_WORKSPACE --version $XXXS_VERSION-$COMMIT-$PYTHON_VERSION \
--description "A Modern RESTful API implemenation of XenAPI for Citrix Hypervisor(R) and XCP-ng." \
--url "https://github.com/Stella-IT/XenXenXenSe" --priority optional --architecture all \
--cmdline "python3 main.py" --dependency python$PYTHON_VERSION --dependency python3-pip \
--maintainer-name "Stella IT" --maintainer-email "[email protected]" --type service
node dist/ --edit --path $GITHUB_WORKSPACE --input-postinst-payload /dev/stdin << EOF
sudo -H -u xenxenxense python3 -m pip install -r requirements.txt
echo "WARNING: config.py is currently default; please edit before use."
EOF
node dist/ --create-deb --path $GITHUB_WORKSPACE --output $GITHUB_WORKSPACE/xenxenxense_$XXXS_VERSION-$COMMIT-$PYTHON_VERSION\_all.deb
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- name: Upload Debian Package
uses: actions/upload-artifact@v2
with:
# Artifact name
name: Debian Package - ${{ matrix.python-version }}
# A file, directory or wildcard pattern that describes what to upload
path: xenxenxense_*_all.deb
- name: Test Debian Package
run: |
COMMIT=$(git rev-parse HEAD | head -c 7)
XXXS_VERSION=$(python3 ./main.py --version)
sudo dpkg --ignore-depends=python$PYTHON_VERSION -i $GITHUB_WORKSPACE/xenxenxense_$XXXS_VERSION-$COMMIT-$PYTHON_VERSION\_all.deb
env:
PYTHON_VERSION: ${{ matrix.python-version }}