Masking out file operations also (#663) #242
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Build | |
on: | |
push: | |
branches: | |
- main | |
- make-rpm | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# There's several of these lists of releases that we're building | |
# for scattered throughout these workflows. Hopefully one day GH | |
# makes it possible to define this in one place and then refer to | |
# it. In the meantime, if you're adding to this list, go look for | |
# other "matrix" definitions. | |
strategy: | |
matrix: | |
include: | |
- distro: centos | |
release: 7 | |
pkg: rpm | |
image: centos | |
- distro: centos | |
release: 8 | |
pkg: rpm | |
image: centos | |
- distro: ubi9 | |
release: 9.2 | |
pkg: rpm | |
image: redhat/ubi9 | |
- distro: ubuntu | |
release: focal | |
pkg: deb | |
image: ubuntu | |
- distro: ubuntu | |
release: jammy | |
pkg: deb | |
image: ubuntu | |
- distro: ubuntu | |
release: lunar | |
pkg: deb | |
image: ubuntu | |
- distro: debian | |
release: bullseye | |
pkg: deb | |
image: debian | |
- distro: debian | |
release: buster | |
pkg: deb | |
image: debian | |
- distro: debian | |
release: bookworm | |
pkg: deb | |
image: debian | |
container: | |
image: ${{ matrix.image }}:${{ matrix.release }} | |
# NB: any run steps that need chf src need to have `working-directory: ${{ env.SRCDIR }}` | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set Version | |
run: | | |
echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | |
echo KENTIK_KTRANSLATE_VERSION=`date +"kt-%Y-%m-%d-${GITHUB_RUN_ID}"` >> $GITHUB_ENV | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21.6' | |
- name: Get Deps | |
run: | | |
if [ "${{ matrix.distro }}" = "centos" ] | |
then | |
if [ "${{ matrix.release }}" = "7" ] | |
then | |
yum install -y make gcc diffutils libpcap-devel | |
else | |
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos | |
yum install -y make gcc diffutils | |
dnf -y --enablerepo=powertools install libpcap-devel | |
fi | |
elif [ "${{ matrix.distro }}" = "ubi9" ] | |
then | |
yum install -y make gcc diffutils libpcap-devel | |
else | |
apt-get update | |
apt-get -y install make libpcap-dev ca-certificates build-essential curl | |
fi | |
- name: Run Make | |
run: | | |
echo ${{ env.KENTIK_KTRANSLATE_VERSION }} | |
echo ${{ env.RELEASE_VERSION }} | |
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} make | |
- name: Run Test | |
run: make test | |
- name: Install MM DBs | |
run: | | |
MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} ./bin/get_mm.sh | |
- name: Create package | |
id: package | |
uses: kentik/pkg@master | |
with: | |
name: ktranslate | |
version: ${{ env.KENTIK_KTRANSLATE_VERSION }} | |
arch: x86_64 | |
format: ${{ matrix.pkg }} | |
package: ktranslate-package.yml | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ steps.package.outputs.package }}--${{ matrix.distro }}-${{ matrix.release }} | |
path: ${{ steps.package.outputs.package }} |