mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 17:11:56 +00:00
4d23ed56c6
* feat(ci): better build workflows * fix(ci/json-build): forgot about the type * chore: test if autobuild works * Revert "chore: test if autobuild works" This reverts commit73fe8e636f. * fix(ci/build): delay setup git * fix(ci/build): need to git add all * fix(ci/build): compact output from jq * chore(ci/build): add run-name * fix(ci/autobuild): inherit secrets Signed-off-by: madomado <madonuko@outlook.com> * fix(ci/build): inherit secrets Signed-off-by: madomado <madonuko@outlook.com> --------- Signed-off-by: madomado <madonuko@outlook.com> (cherry picked from commit4cc7cb792a) # Conflicts: # .github/workflows/autobuild.yml # .github/workflows/build.yml # .github/workflows/json-build.yml Co-authored-by: madomado <madonuko@outlook.com>
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
name: Manual Builds
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
packages:
|
|
description: "Packages to Build"
|
|
required: true
|
|
custom_builder:
|
|
description: "Custom Builder"
|
|
required: false
|
|
default: ""
|
|
architecture:
|
|
description: "Architectures"
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
|
|
run-name: ${{ inputs.packages }}
|
|
|
|
jobs:
|
|
manifest:
|
|
outputs:
|
|
build_matrix: ${{ steps.parsing.outputs.build_matrix }}
|
|
runs-on: ubuntu-22.04
|
|
container:
|
|
image: ghcr.io/terrapkg/builder:frawhide
|
|
options: --cap-add=SYS_ADMIN --privileged
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
git config user.name "Raboneko"
|
|
git config user.email "raboneko@fyralabs.com"
|
|
- name: Parse Input
|
|
id: parsing
|
|
run: |
|
|
for pkg in ${{ inputs.packages }}; do
|
|
touch anda/$pkg/.build
|
|
done
|
|
git add --all
|
|
git commit -a -m "tmp"
|
|
b=$(anda ci | sed -E 's@^build_matrix=@@')
|
|
if [ "${{ inputs.architecture }}" != "" ]; then
|
|
# e.g.: [ unique_by(.pkg)[] | (.arch="x86_64", .arch="aarch64") ]
|
|
filter=`echo -n "${{ inputs.architecture }}" | tr '[:space:]' '\n' | sed -E '/^$/d; s@^.+$@.arch="\0"@' | tr '\n' ', '`
|
|
b=`echo $b | jq -c '[unique_by(.pkg)[] | ('"$filter"')]'`
|
|
elif [ "${{ inputs.custom_builder }}" != "" ]; then
|
|
b=`echo $b | jq -c 'unique_by(.pkg)'`
|
|
fi
|
|
echo "build_matrix=$b" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
needs: manifest
|
|
uses: ./.github/workflows/json-build.yml
|
|
secrets: inherit
|
|
with:
|
|
packages: ${{ needs.manifest.outputs.build_matrix }}
|
|
custom_builder: ${{ inputs.custom_builder }}
|