Skip to content

Build Binaries

Build Binaries #2

name: Build Binaries
on:
workflow_dispatch:
inputs:
commit:
description: 'Commit binaries'
required: false
default: false
type: boolean
env:
TARGET_DIR: /tmp/output
COMMIT_DIR: ${{github.workspace}}/services/bin
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run build-binaries.sh
run: ${{github.workspace}}/tools/build-binaries.sh
shell: bash
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v3
with:
name: binaries-${{github.run_id}}
path: ${{env.TARGET_DIR}}
if-no-files-found: error
- name: Commit binaries
if: inputs.commit
shell: bash
run: |
git config user.name 'GitHub workflow[bot]'
git config user.email '<>'
for f in "${TARGET_DIR}/"*; do
t="${COMMIT_DIR}/$(basename -- "${f}")"
cp -v -- "${f}" "${t}"
git add -- "${t}"
done
git commit -m "Build binaries" -m "Run ID ${GITHUB_RUN_ID}"
git push origin "${GITHUB_REF}"