Skip to content

build audioserve

build audioserve #46

Workflow file for this run

name: build audioserve
on:
workflow_dispatch:
inputs:
ref:
description: 'git reference to checkout and build'
required: true
default: 'master'
type: string
workflow_call:
inputs:
ref:
description: 'git reference to checkout and build'
required: true
default: 'master'
type: string
env:
REGISTRY: ghcr.io
BUILDER_IMAGE: srd424/audioserve-builder
BUILD_TYPE: release
BUILDER_TAG: ${{ github.ref_name == 'master' && 'latest' || github.ref_name }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout builder repo inc fixups
uses: actions/checkout@v2
- name: checkout audioserve source
uses: actions/checkout@v3
with:
repository: 'izderadicka/audioserve'
path: audioserve-src
ref: ${{ inputs.ref }}
- name: generate release name
id: genrel
run: |
set -x
if [ "${{ inputs.ref }}" = "master" ]; then
rev=$(cd audioserve-src && git rev-parse --short HEAD)
echo "::set-output name=release_ref::trunk-$rev"
echo "::set-output name=release_tag::trunk-${rev}_$(date +%y%m%d%H%M)"
else
echo "::set-output name=release_ref::${{ inputs.ref }}"
echo "::set-output name=release_tag::${{ inputs.ref }}_$(date +%y%m%d%H%M)"
fi
- name: cache build cache
uses: actions/cache@v3
with:
path: build
key: as0-${{ env.BUILD_TYPE }}-${{ steps.genrel.outputs.release_ref }}
restore-keys: |
as0-${{ env.BUILD_TYPE }}-
as0-
as
- name: Docker pull
run: docker pull ${{ env.REGISTRY }}/${{ env.BUILDER_IMAGE }}:${{ env.BUILDER_TAG }}
- name: Docker run
run: |
mkdir -p ./result ./build && \
docker run -v ${GITHUB_WORKSPACE}/audioserve-src:/src -v $PWD/build:/build \
-v $PWD/result:/result -v $PWD/fixups:/fixups -e CARGO_PROFILE=${{ env.BUILD_TYPE }} \
${{ env.REGISTRY }}/${{ env.BUILDER_IMAGE }}:${{ env.BUILDER_TAG }}
- name: zip results
run: zip -r audioserve_aarch64.zip result
- name: Release zip
uses: softprops/action-gh-release@v1
with:
files: audioserve_aarch64.zip
tag_name: ${{ steps.genrel.outputs.release_tag }}
# vim: set ts=2 et: