Skip to content

OM152 - Package name correction for rpms and removal of debian10 (#102) #6

OM152 - Package name correction for rpms and removal of debian10 (#102)

OM152 - Package name correction for rpms and removal of debian10 (#102) #6

# This workflow will build a golang project
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build exporter deb,rpm and tgz artifacts
on:
push:
# branches: [master]
# TODO this combination logic of branch + tag is not working.
tags:
- v*
permissions:
id-token: write
actions: write
contents: write
jobs:
job_build:
strategy:
fail-fast: false
matrix:
arch: ["amd64","arm64"]
container: ["ubuntu:20.04","ubuntu:22.04","redhat:8","redhat:9","amazonlinux:2023","debian:11","debian:12"]
include:
- container: "ubuntu:22.04"
name: "Ubuntu22.04"
cmd: "make deb"
ext: "deb"
- container: "ubuntu:20.04"
name: "Ubuntu20.04"
cmd: "make deb"
ext: "deb"
- container: "redhat:8"
cmd: "make rpm"
ext: "rpm"
- container: "redhat:9"
cmd: "make rpm"
ext: "rpm"
- container: "amazonlinux:2023"
cmd: "make rpm"
ext: "rpm"
- container: "debian:11"
cmd: "make deb"
ext: "deb"
- container: "debian:12"
cmd: "make deb"
ext: "deb"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/${{ matrix.arch }}
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to JFrog
uses: docker/login-action@v2
with:
registry: aerospike.jfrog.io
username: ${{ secrets.JFROG_ARTIFACTORY_USER }}
password: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
- name: Build OS and Platform specific artifact
id: build-artifact
run: |
docker run -v ${{ github.workspace }}:/src/ -w /src/ --platform linux/${{ matrix.arch }} aerospike.jfrog.io/devops-containers-prod-local/fpm-${{ matrix.container }} ${{ matrix.cmd }}
- name: Upload Release Asset
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: "${{ steps.get-latest-tag.outputs.tag }}"
run: |
# echo "tag_name $TAG_NAME"
echo
files=$(find pkg/target -type f -name "aerospike-prome*" -printf "$(realpath -s %p) ")
for file in $files; do
echo "uploading file === $file to release-tag $TAG_NAME"
gh release upload "$TAG_NAME" "$file"
done
echo
echo "lising of files ... "
echo
ls -lst pkg/target/*