Skip to content

v2.2.32

v2.2.32 #75

Workflow file for this run

on:
release:
types: [edited, created]
name: Upload Release
jobs:
get_mm:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install MM DBs
run: |
YOUR_ACCOUNT_ID=${{ secrets.MM_ACCOUNT_ID }} MAXMIND_LICENSE_KEY=${{ secrets.MM_DOWNLOAD_KEY }} ./bin/get_mm.sh
- name: 'Upload MM Geo DB'
uses: actions/upload-artifact@v4
with:
name: GeoLite2-Country.mmdb
path: config/GeoLite2-Country.mmdb
retention-days: 1
- name: 'Upload MM ASN DB'
uses: actions/upload-artifact@v4
with:
name: GeoLite2-ASN.mmdb
path: config/GeoLite2-ASN.mmdb
retention-days: 1
build:
runs-on: ubuntu-latest
continue-on-error: true
needs: get_mm
strategy:
matrix:
include:
- distro: ubi
release: 8
pkg: rpm
pkg_name: el
image: redhat/ubi8:8.9
- distro: ubi
release: 9
pkg: rpm
pkg_name: el
image: redhat/ubi9:9.2
- distro: ubuntu
release: focal
pkg: deb
pkg_name: ubuntu
image: ubuntu:focal
- distro: ubuntu
release: jammy
pkg: deb
pkg_name: ubuntu
image: ubuntu:jammy
- distro: ubuntu
release: noble
pkg: deb
pkg_name: ubuntu
image: ubuntu:noble
- distro: debian
release: bullseye
pkg: deb
pkg_name: debian
image: debian:bullseye
- distro: debian
release: buster
pkg: deb
pkg_name: debian
image: debian:buster
- distro: debian
release: bookworm
pkg: deb
pkg_name: debian
image: debian:bookworm
container:
image: ${{ matrix.image }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get MM Geo
uses: dawidd6/action-download-artifact@v6
with:
name: GeoLite2-Country.mmdb
path: ./config
run_id: ${{ github.run_id }}
- name: Get MM Asn
uses: dawidd6/action-download-artifact@v6
with:
name: GeoLite2-ASN.mmdb
path: ./config
run_id: ${{ github.run_id }}
- name: Set Version
run: |
echo "KENTIK_KTRANSLATE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo ${{ github.ref_name }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.22.6'
- name: Get Deps
shell: bash
run: |
if [ "${{ matrix.distro }}" = "centos" ]
then
if [ "${{ matrix.release }}" = "7" ]
then
yum install -y centos-release-scl
yum install -y make gcc diffutils libpcap-devel rh-ruby27 rh-ruby27-ruby-devel redhat-rpm-config gcc-c++ rh-ruby27-rubygems
scl enable rh-ruby27 bash
else
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
yum install -y make gcc diffutils ruby-devel redhat-rpm-config gcc-c++
dnf -y --enablerepo=powertools install libpcap-devel
fi
elif [ "${{ matrix.distro }}" = "ubi" ]
then
if [ "${{ matrix.release }}" = "8" ]
then
yum install -y make gcc diffutils libpcap-devel microdnf gcc-c++ redhat-rpm-config
microdnf module enable ruby:2.7
microdnf install ruby
else
yum install -y make gcc diffutils libpcap-devel ruby-devel gcc-c++ redhat-rpm-config
fi
else
apt-get update
apt-get -y install make libpcap-dev ca-certificates build-essential curl ruby ruby-dev
fi
- name: Run Make
run: |
echo ${{ env.KENTIK_KTRANSLATE_VERSION }}
KENTIK_KTRANSLATE_VERSION=${{ env.KENTIK_KTRANSLATE_VERSION }} make
- name: Run Test
run: make test
- 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: Send to packagecloud
shell: bash
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
if [ "${{ matrix.release }}" = "7" ] # Centos7 is extra hard to work with.
then
export PATH=/opt/rh/rh-ruby27/root/usr/local/bin:/opt/rh/rh-ruby27/root/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin
export LD_LIBRARY_PATH=/opt/rh/rh-ruby27/root/usr/local/lib64:/opt/rh/rh-ruby27/root/usr/lib64
ruby -v
gem -v
fi
REPO="${{ github.event.repository.name }}"
if [ "${{ matrix.release }}" = "buster" ] # Also some special casing here for buster
then
gem install rake
gem install thor -v 1.2.2
gem install domain_name -v 0.5.20190701
fi
gem install package_cloud
package_cloud push kentik/$REPO/${{ matrix.pkg_name }}/${{ matrix.release }} ${{ steps.package.outputs.package }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.package.outputs.package }}
asset_name: ${{ steps.package.outputs.package }}--${{ matrix.distro }}-${{ matrix.release }}
asset_content_type: application/binary