Build package #50
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: Build package | |
on: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: "Package to build" | |
required: true | |
type: string | |
jobs: | |
pkg: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
# To ensure binaries built are compatible with Block's Kochiku worker environment | |
container: centos:centos7 | |
- os: macos-12 | |
steps: | |
- name: Install required dependencies on CentOS | |
if: startsWith(matrix.container, 'centos') | |
# 1. Endpoint repo is required to get recent version of git so checkout action will checkout code | |
# as a local git repo instead of falling back to downloading the repo's files using the GitHub REST API | |
# 2. enable "software collections" (scl) repositories for extra packages | |
# 3. install newer gcc, etc in order to support newer C++ standards | |
# 4. python 3 is required by nodejs build | |
run: | | |
curl -LO https://packages.endpointdev.com/endpoint-rpmsign-7.pub | |
rpm --import endpoint-rpmsign-7.pub | |
yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm | |
yum install -y centos-release-scl | |
yum install --assumeyes git gcc python3 devtoolset-11-gcc* | |
# Work-around for https://github.com/actions/runner-images/issues/6775 | |
- name: Change Owner of Container Working Directory | |
if: matrix.container | |
run: chown root:root . | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Init Hermit | |
uses: cashapp/activate-hermit@v1 | |
- name: Build | |
id: build | |
run: | | |
if [ -f /opt/rh/devtoolset-11/enable ]; then . /opt/rh/devtoolset-11/enable; fi | |
make -C pkgs/${{ inputs.package }} | |
make -s -C pkgs/${{ inputs.package }} version | |
echo "VERSION=$(make -s -C pkgs/${{ inputs.package }} version)" >> $GITHUB_OUTPUT | |
- name: Upload Release | |
# Use old version of the release-action, as newer releases use node-20 which is not compatible with CentOS 7 | |
uses: ncipollo/release-action@8c78ca2662b7f5b8d5e5d5b5dbad3a5f38911fc0 | |
with: | |
tag: ${{ inputs.package }}-${{ steps.build.outputs.VERSION }} | |
allowUpdates: true | |
artifacts: "pkgs/${{ inputs.package }}/${{ inputs.package }}-${{ steps.build.outputs.VERSION }}-*.tar.xz" | |
token: ${{ secrets.GITHUB_TOKEN }} |