-
Notifications
You must be signed in to change notification settings - Fork 10
149 lines (130 loc) · 4.43 KB
/
deb.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
name: Build Debian Packages
on:
push:
pull_request:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
is_release_build: ${{ env.RELEASE_BUILD == '1' }}
steps:
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ secrets.SDK_URL }}
JF_ACCESS_TOKEN: ${{ secrets.SDK_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
# login
- run: |
jf c add --url=$JF_URL --access-token=$JF_ACCESS_TOKEN --interactive=false
# download·
- name: Download files from Artifactory
id: get_matrix
run: |
set +x
set -e
build_config=$(cat .github/workflows/build_config.json)
for os in $(echo $build_config | jq -r 'keys[]'); do
for pylon_sdk in $(echo $build_config | jq -r --arg os "$os" '.[$os].pylon_sdk_packaging'); do
if [[ $os == "linux-x86_64" ]]; then
jf rt dl --flat --props "pylon_architecture=x86_64;pylon_os=linux;pylon_version=$pylon_sdk;pylon_packaging=deb" "pylon-sdks-generic/*" ./linux_x86_64_sdk/
elif [[ $os == "linux-aarch64" ]]; then
jf rt dl --flat --props "pylon_architecture=aarch64;pylon_os=linux;pylon_version=$pylon_sdk;pylon_packaging=deb" "pylon-sdks-generic/*" ./linux_aarch64_sdk/
fi
done
done
- name: Upload Pylon SDK for Linux aarch64
uses: actions/upload-artifact@v4
with:
name: Linux_aarch64_packaging_Pylon
path: linux_aarch64_sdk
- name: Upload Pylon SDK for Linux x86_64
uses: actions/upload-artifact@v4
with:
name: Linux_x86_64_packaging_Pylon
path: linux_x86_64_sdk
- name: Check for release build
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "Build release for $GITHUB_REF"
echo "RELEASE_BUILD=1" >> $GITHUB_ENV
build_deb:
runs-on: ubuntu-latest
needs: setup
strategy:
fail-fast: false
matrix:
os:
- ubuntu:24.04
- ubuntu:22.04
- ubuntu:20.04
- debian:bookworm
- debian:bullseye
arch: ["arm64", "amd64"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download x86_64
if: matrix.arch == 'amd64'
uses: actions/download-artifact@v4
with:
name: Linux_x86_64_packaging_Pylon
path: pylon-installer
- name: Download aarch64
if: matrix.arch == 'arm64'
uses: actions/download-artifact@v4
with:
name: Linux_aarch64_packaging_Pylon
path: pylon-installer
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64, linux/arm64
- name: Set sanitized OS name
id: sanitize_os
run: |
SANITIZED_OS=$(echo ${{ matrix.os }} | sed 's/:/./g')
echo "SANITIZED_OS=$SANITIZED_OS" >> $GITHUB_ENV
- name: Build Debian Package
uses: jtdor/build-deb-action@v1
env:
DEB_BUILD_OPTIONS: noautodbgsym
with:
setup-hook: |
ln -sfn packaging/debian
apt-get update
(cd /pylon-installer && tar -xvf *.tar.gz && apt-get install -y ./*.deb)
# patch version to contain platform info
tools/patch_deb_changelog.sh
docker-image: ${{ matrix.arch == 'arm64' && format('arm64v8/{0}', matrix.os) || format('{0}', matrix.os) }}
extra-docker-args: -v ${{ github.workspace }}/pylon-installer:/pylon-installer -e PYLON_ROOT=/opt/pylon
buildpackage-opts: --build=binary --no-sign
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debian-packages-${{ env.SANITIZED_OS }}-${{ matrix.arch }}
path: debian/artifacts/
- name: Upload Release Asset
if: needs.setup.outputs.is_release_build == 'true'
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ./debian/artifacts/*.deb
cleanup:
if: always()
needs: [
setup,
build_deb
]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
continue-on-error: true
with:
name: |
Linux_x86_64_packaging_Pylon
Linux_aarch64_packaging_Pylon