-
-
Notifications
You must be signed in to change notification settings - Fork 32
166 lines (164 loc) · 5.18 KB
/
packaging.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Building Koan packages
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
build-rockylinux-rpms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build a RockyLinux 8 Package
shell: 'script -q -e -c "bash {0}"'
run: |
./docker/rpms/build-and-install-rpms.sh rl8 docker/rpms/RockyLinux8/RockyLinux8.dockerfile
- name: Archive RPMs
uses: actions/upload-artifact@v3
with:
name: rpms-rockylinux
path: |
rpm-build/*.rpm
build-fedora-rpms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build a Fedora Package
shell: 'script -q -e -c "bash {0}"'
run: |
./docker/rpms/build-and-install-rpms.sh fc36 docker/rpms/Fedora/Fedora.dockerfile
- name: Archive RPMs
uses: actions/upload-artifact@v3
with:
name: rpms-fedora
path: |
rpm-build/*.rpm
build-opensuse-leap-rpms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install System dependencies
run: sudo apt-get install -y rename
- name: Build a openSUSE Leap 15.3 Package
shell: 'script -q -e -c "bash {0}"'
run: |
./docker/rpms/build-and-install-rpms.sh opensuse-leap docker/rpms/openSUSE_Leap_15.3/openSUSE_Leap_15.3.dockerfile
- name: Rename RPM
run: |
file-rename -v -d -e 's/koan-(\d+\.\d+\.\d+)-1\.(\w+)\.rpm/koan-$1-1.leap.$2.rpm/' rpm-build/*.rpm
- name: Archive RPMs
uses: actions/upload-artifact@v3
with:
name: rpms-opensuse-leap
path: |
rpm-build/*.rpm
build-opensuse-tumbleweed-rpms:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install System dependencies
run: sudo apt-get install -y rename
- name: Build a openSUSE Tumbleweed Package
shell: 'script -q -e -c "bash {0}"'
run: |
./docker/rpms/build-and-install-rpms.sh opensuse-tumbleweed docker/rpms/openSUSE_Tumbleweed/openSUSE_TW.dockerfile
- name: Rename RPM
run: |
file-rename -v -d -e 's/koan-(\d+\.\d+\.\d+)-1\.(\w+)\.rpm/koan-$1-1.tw.$2.rpm/' rpm-build/*.rpm
- name: Archive RPMs
uses: actions/upload-artifact@v3
with:
name: rpms-opensuse-tumbleweed
path: |
rpm-build/*.rpm
build-debian-debs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build a Debian 10 Package
shell: 'script -q -e -c "bash {0}"'
run: |
./docker/debs/build-and-install-debs.sh deb10 docker/debs/debian/Debian10.dockerfile
- name: Archive DEBs
uses: actions/upload-artifact@v3
with:
name: debs-debian
path: |
deb-build/DEBS/all/*.deb
build-wheel:
name: Build Python Wheel
runs-on: ubuntu-latest
# TODO: Move directly to Ubuntu - libvirt problems on GHA
container: registry.opensuse.org/opensuse/tumbleweed:latest
steps:
- name: Install system dependencies
run: >-
zypper -n in --no-recommends
git
tar
make
python3
python3-base
python3-wheel
python3-build
python3-setuptools
python3-pip
python3-libvirt-python
python3-Sphinx
python3-netifaces
tree
- uses: actions/checkout@v4
- name: Mark directory as safe for Git
run: git config --global --add safe.directory /__w/koan/koan
- name: Install dependencies
run: pip3 install --break-system-packages .
- name: Build a binary wheel and a source tarball
run: make release
- name: Show tree
run: tree
- name: Archive Wheel
uses: actions/upload-artifact@v3
with:
name: wheel
path: |
dist/*.whl
dist/*.tar.gz
create-release:
name: Build the release and create a GitHub release
runs-on: ubuntu-latest
needs: [
build-rockylinux-rpms,
build-fedora-rpms,
build-opensuse-leap-rpms,
build-opensuse-tumbleweed-rpms,
build-debian-debs,
build-wheel
]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
name: Download all built artifacts
with:
path: artifacts
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Release
# https://github.com/softprops/action-gh-release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Koan ${{ env.RELEASE_VERSION }}
discussion_category_name: "Announcements"
files: |
artifacts/debs-debian/*.deb
artifacts/rpms-fedora/*.rpm
artifacts/rpms-opensuse-leap/*.rpm
artifacts/rpms-opensuse-tumbleweed/*.rpm
artifacts/rpms-rockylinux/*.rpm
artifacts/wheel/*.tar.gz
artifacts/wheel/*.whl
body_path: changelog/${{ env.RELEASE_VERSION }}.md