Skip to content

update [email protected] (#737)

update [email protected] (#737) #297

Workflow file for this run

name: CI package
on:
workflow_dispatch:
push:
paths:
- programs/ziti-edge-tunnel/package/*
- .github/actions/openziti-tunnel-build-action/*
- .github/workflows/cpack.yml
release:
types:
- published
jobs:
package:
runs-on: ubuntu-20.04
# optionally override entire container image:tag string
container: ${{ matrix.distro.container || format('{0}:{1}', matrix.distro.name, matrix.distro.version) }}
# only override container image name and tag is distro version
#container: ${{ matrix.distro.container || matrix.distro.name }}:${{ matrix.distro.version }}
strategy:
fail-fast: false
matrix:
arch:
- cmake: ci-linux-x64 # selects cmake preset
rpm: x86_64 # yum $basearch
deb: amd64 # dpkg --print-architecture
- cmake: ci-linux-arm
rpm: armhfp
deb: armhf
- cmake: ci-linux-arm64
rpm: aarch64
deb: arm64
distro:
- name: ubuntu
version: "22.04"
release_name: jammy
type: deb
- name: ubuntu
version: "20.04"
release_name: focal
type: deb
- name: ubuntu
version: "18.04"
release_name: bionic
type: deb
- name: ubuntu
version: "16.04"
release_name: xenial
type: deb
- name: redhat
version: "7"
release_name: ${{ null }}
type: rpm
container: docker.io/library/centos:7
- name: redhat
version: "8"
release_name: ${{ null }}
type: rpm
container: docker.io/library/rockylinux:8
- name: redhat
version: "9"
release_name: ${{ null }}
type: rpm
container: docker.io/library/rockylinux:9
exclude:
- distro:
name: ubuntu
release_name: xenial
arch:
cmake: ci-linux-arm
- distro:
name: ubuntu
release_name: xenial
arch:
cmake: ci-linux-arm64
- distro:
name: ubuntu
release_name: bionic
arch:
cmake: ci-linux-arm
- distro:
name: redhat
arch:
cmake: ci-linux-arm
- distro:
name: redhat
arch:
cmake: ci-linux-arm64
steps:
# only focal-20.04 has >= 2.18, which is required by actions/checkout to clone
# which enables cmake version discovery
- name: install contemporary Git in runner container if Ubuntu
if: ${{ matrix.distro.name == 'ubuntu' }}
run: |
apt -y update
apt-get -y install software-properties-common
add-apt-repository -y ppa:git-core/ppa
apt -y update
apt -y install git
git --version
- name: install contemporary Git in runner container if RedHat 8 or 9
if: ${{ matrix.distro.name == 'redhat' && (matrix.distro.version == '8' || matrix.distro.version == '9') }}
run: |
dnf -y update
dnf -y install git
git --version
- name: install contemporary Git in runner container if RedHat 7
if: ${{ matrix.distro.name == 'redhat' && matrix.distro.version == '7' }}
run: |
yum -y update
yum -y install centos-release-scl
yum -y install rh-git218
source scl_source enable rh-git218 && git --version
cat << 'EOF' >| /root/git.sh
#!/bin/bash
source scl_source enable rh-git218 && git "${@}"
EOF
chmod +x /root/git.sh
update-alternatives --install /usr/bin/git git /root/git.sh 50
- name: checkout workspace
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: configure build action for distro version
env:
DISTRO_LABEL: ${{ format('{0}-{1}', matrix.distro.name, matrix.distro.version) }}
shell: bash
run: |
mv -v ./.github/actions/openziti-tunnel-build-action/${DISTRO_LABEL}/* ./.github/actions/openziti-tunnel-build-action/
# entrypoint.sh uses the value of arch to select the cmake preset
- name: build binary and package
uses: ./.github/actions/openziti-tunnel-build-action
with:
arch: ${{ matrix.arch.cmake }}
config: Release
- name: list build artifacts
run: |
cat /etc/*-release
ls -horAS ./build/
- name: list program artifacts
run: |
cat /etc/*-release
ls -horAS ./build/programs/ziti-edge-tunnel/
- name: install package artifact in runner container if Ubuntu x86_64
if: ${{ matrix.arch.cmake == 'ci-linux-x64' && matrix.distro.name == 'ubuntu' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt -y install ./build/ziti-edge-tunnel-*.deb
- name: install package artifact in runner container if RedHat
if: ${{ matrix.arch.cmake == 'ci-linux-x64' && matrix.distro.name == 'redhat' }}
run: |
set -x
yum -y install ./build/ziti-edge-tunnel-*.rpm
- name: run binary artifact
if: ${{ matrix.arch.cmake == 'ci-linux-x64' }}
run: |
set -x
cat /etc/*-release
ldd ./build/programs/ziti-edge-tunnel/Release/ziti-edge-tunnel
./build/programs/ziti-edge-tunnel/Release/ziti-edge-tunnel version --verbose
- name: upload package artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.distro.name }}-${{ matrix.distro.version }}-${{ matrix.arch.rpm }}-${{ matrix.distro.type }}
path: ./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
if-no-files-found: error
- name: Configure jFrog CLI
if: ${{ github.event_name == 'release' && !github.event.release.prerelease && startsWith(github.ref, 'refs/tags/v') }}
uses: jfrog/setup-jfrog-cli@v3
env:
JF_ENV_1: ${{ secrets.ZITI_ARTIFACTORY_CLI_CONFIG_PACKAGE_UPLOAD }}
- name: Upload RPM to Artifactory with jFrog CLI
if: ${{ github.event_name == 'release' && !github.event.release.prerelease && startsWith(github.ref, 'refs/tags/v') && matrix.distro.name == 'redhat' }}
run: >
jf rt upload
./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
/zitipax-openziti-rpm-stable/redhat${{ matrix.distro.version }}/${{ matrix.arch.rpm }}/
--recursive=false
--flat=true
- name: Upload DEB to Artifactory with jFrog CLI
if: ${{ github.event_name == 'release' && !github.event.release.prerelease && startsWith(github.ref, 'refs/tags/v') && matrix.distro.name == 'ubuntu' }}
run: >
jf rt upload
./build/ziti-edge-tunnel-*.${{ matrix.distro.type }}
/zitipax-openziti-deb-stable/pool/ziti-edge-tunnel/${{ matrix.distro.release_name }}/${{ matrix.arch.deb }}/
--deb=${{ matrix.distro.release_name }}/main/${{ matrix.arch.deb }}
--recursive=false
--flat=true