-
Notifications
You must be signed in to change notification settings - Fork 24
138 lines (118 loc) · 4.51 KB
/
lua-cffi.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
name: lua-cffi
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- dependencies/lua-cffi/**
push:
branches:
- develop
- master
paths:
- dependencies/lua-cffi/**
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
package:
needs: [get-environment]
strategy:
fail-fast: false
matrix:
distrib: [el8, el9, bullseye]
include:
- package_extension: rpm
image: packaging-stream-connectors-alma8
distrib: el8
- package_extension: rpm
image: packaging-stream-connectors-alma9
distrib: el9
- package_extension: deb
image: packaging-stream-connectors-bullseye
distrib: bullseye
runs-on: ubuntu-22.04
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
name: package ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install dependencies
run: |
if [ "${{ matrix.package_extension }}" = "rpm" ]; then
dnf install -y make gcc luarocks meson gcc-c++ cmake libffi libffi-devel
else
apt-get update
apt-get install -y make gcc luarocks meson cmake libffi7 libffi-dev
fi
shell: bash
- name: Prepare packaging of lua-cffi
run: |
luarocks install cffi-lua
luarocks show cffi-lua | grep "cffi-lua\s[0-9]" | cut -d' ' -f2 | perl -nle 'm/(\d+\.\d+(\.\d+)?)/; print $1' >> version.txt
cat version.txt
mkdir lua-cffi
find /usr/ -type f -name "cffi.so" -exec cp {} lua-cffi/ \;
working-directory: dependencies/lua-cffi
shell: bash
- name: Export package version
id: package-version
run: echo "package_version=`cat version.txt`" >> $GITHUB_OUTPUT
shell: bash
working-directory: dependencies/lua-cffi
- name: Package
uses: ./.github/actions/package-nfpm
with:
nfpm_file_pattern: "dependencies/lua-cffi/packaging/*.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
arch: amd64
version: ${{ steps.package-version.outputs.package_version }}
commit_hash: ${{ github.sha }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
deliver-rpm:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [el8, el9]
name: deliver ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish RPM packages
uses: ./.github/actions/rpm-delivery
with:
module_name: lua-cffi
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-lua-cffi-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
deliver-deb:
if: ${{ contains(fromJson('["unstable", "testing", "stable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [bullseye]
name: deliver ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish DEB packages
uses: ./.github/actions/deb-delivery
with:
module_name: lua-cffi
distrib: ${{ matrix.distrib }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-lua-cffi-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}