forked from webosbrew/webos-homebrew-channel
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.09 KB
/
build-binaries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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@v4
- name: Run build-binaries.sh
run: ${{ github.workspace }}/tools/build-binaries.sh
shell: bash
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v4
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}"