mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
80 lines
2.5 KiB
YAML
80 lines
2.5 KiB
YAML
name: Solus eopkg build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
package_yml:
|
|
description: "Path to Solus package.yml for ypkg build"
|
|
required: false
|
|
default: "packaging/solus/package.yml"
|
|
solus_image:
|
|
description: "Solus container image"
|
|
required: false
|
|
default: "docker.io/silkeh/solus:latest"
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
jobs:
|
|
build-eopkg:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
SOLUS_IMAGE: ${{ inputs.solus_image || 'docker.io/silkeh/solus:latest' }}
|
|
PACKAGE_YML: ${{ inputs.package_yml || 'packaging/solus/package.yml' }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to GHCR (for ghcr.io images)
|
|
if: startsWith(env.SOLUS_IMAGE, 'ghcr.io/')
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Build eopkg package in Solus container
|
|
run: |
|
|
if [ ! -f "$PACKAGE_YML" ]; then
|
|
echo "Expected Solus packaging file at $PACKAGE_YML" >&2
|
|
echo "Available package.yml files:" >&2
|
|
find . -name "package.yml" -print >&2 || true
|
|
echo "Add a package.yml (ypkg) file or update the workflow input PACKAGE_YML." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! docker pull "$SOLUS_IMAGE"; then
|
|
echo "Failed to pull SOLUS_IMAGE=$SOLUS_IMAGE" >&2
|
|
echo "Set workflow input 'solus_image' to a valid image that provides eopkg/ypkg." >&2
|
|
exit 1
|
|
fi
|
|
|
|
docker run --rm \
|
|
-v "$PWD":/workspace \
|
|
-w /workspace \
|
|
-e PACKAGE_YML="$PACKAGE_YML" \
|
|
"$SOLUS_IMAGE" \
|
|
sh -lc '
|
|
set -euo pipefail
|
|
eopkg update-repo -y
|
|
# Do not remove openssl-11 here: it can trigger a very large
|
|
# dependency cascade (including python3/eopkg itself), which
|
|
# breaks the build environment before package build starts.
|
|
eopkg install -y ypkg git
|
|
ypkg build "$PACKAGE_YML"
|
|
mkdir -p /workspace/artifacts
|
|
find . -maxdepth 3 -name "*.eopkg" -type f -exec cp -v {} /workspace/artifacts/ \;
|
|
'
|
|
|
|
- name: Upload eopkg artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: solus-eopkg
|
|
path: artifacts/*.eopkg
|
|
if-no-files-found: error
|