-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: xplshn <[email protected]>
- Loading branch information
Showing
2 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: Build and Release AppBundles - ng | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
workflow_dispatch: | ||
inputs: | ||
script_pattern: | ||
description: "Pattern to match scripts to build (leave empty to build all)" | ||
required: false | ||
default: "" | ||
|
||
jobs: | ||
build: | ||
name: Build and Release Packages | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
|
||
- name: Prepare environment | ||
run: | | ||
GOBIN="$HOME/.local/bin" | ||
mkdir -p "$GOBIN" | ||
git clone --depth 1 --branch dev https://github.com/xplshn/pelf | ||
cp ./pelf/pelf* "$GOBIN" | ||
cp ./pelf/cmd/misc/* "$GOBIN" | ||
echo "GOBIN=$GOBIN" >> $GITHUB_ENV | ||
- name: Build pelfd and lib4bin | ||
run: | | ||
cd pelf/cmd/pelfd | ||
go build -o "$GOBIN/pelfd" | ||
cd ../dynexec/lib4bin | ||
go build -o "$GOBIN/lib4bin" | ||
- name: Install tools | ||
run: | | ||
DBIN_PGRS="dwarfs-tools bwrap-patched sharun yq jq eget2" | ||
wget -qO- "https://raw.githubusercontent.com/xplshn/dbin/master/stubdl" | sh -s -- --install "$GOBIN/dbin" add $DBIN_PGRS | ||
PATH="$GOBIN:$PATH" | ||
ln -sfT "$GOBIN/dwarfs-tools" "$GOBIN/mkdwarfs" | ||
ln -sfT "$GOBIN/dwarfs-tools" "$GOBIN/dwarfs" | ||
ln -sfT "$GOBIN/bwrap-patched" "$GOBIN/bwrap" | ||
echo "PATH=$PATH" >> $GITHUB_ENV | ||
- name: Download Alpine RootFS | ||
id: rootfs | ||
run: | | ||
ROOTFS_URL="$(curl -qsL https://dl-cdn.alpinelinux.org/alpine/edge/releases/x86_64/latest-releases.yaml | yq '.[0].file')" | ||
ROOTFS_URL="https://dl-cdn.alpinelinux.org/alpine/edge/releases/$(uname -m)/${ROOTFS_URL}" | ||
echo "ROOTFS_URL=$ROOTFS_URL" >> $GITHUB_ENV | ||
- name: Create pelf environment | ||
run: | | ||
pelfCreator -m xplshn -n devEnv -p "fuse3 build-base go git" -z -c | ||
- name: List available scripts | ||
run: | | ||
echo "Listing available scripts in recipes:" | ||
ls -l "${{ github.workspace }}/recipes/" | ||
- name: Run selected build scripts | ||
run: | | ||
SCRIPT_PATTERN="${{ github.event.inputs.script_pattern }}" | ||
if [ -z "$SCRIPT_PATTERN" ]; then | ||
echo "No script pattern provided, running all scripts." | ||
PATTERN=".*" # Match all scripts | ||
else | ||
echo "Pattern provided: $SCRIPT_PATTERN" | ||
PATTERN="$SCRIPT_PATTERN" | ||
fi | ||
for script in "${{ github.workspace }}/recipes/"*/*.*sh; do | ||
if echo "$script" | grep -E "$PATTERN"; then | ||
echo "Running $script" | ||
chmod +x "$script" | ||
${{ github.workspace }}/devEnv*/AppRun "$script" | ||
else | ||
echo "Skipping $script (does not match pattern)" | ||
fi | ||
done | ||
- name: Archive output | ||
run: | | ||
OUT_DIR="/tmp/APPBUNDLES" | ||
ls "$OUT_DIR" | ||
echo "OUT_DIR=${OUT_DIR}" >> $GITHUB_ENV | ||
- name: Manage Tags | ||
run: | | ||
git fetch --tags | ||
TAGS=$(git tag | sort -V) | ||
TAG_COUNT=$(echo "$TAGS" | wc -l) | ||
if [ "$TAG_COUNT" -gt 5 ]; then | ||
TAGS_TO_DELETE=$(echo "$TAGS" | head -n -1) | ||
for TAG in $TAGS_TO_DELETE; do | ||
echo "Deleting tag: $TAG" | ||
git tag -d "$TAG" | ||
git push origin --delete "$TAG" | ||
done | ||
else | ||
echo "Tag count is $TAG_COUNT, no tags to delete." | ||
fi | ||
- name: Create Release | ||
uses: softprops/[email protected] | ||
with: | ||
name: "Weekly Release - ${{ env.UTC_TIME }}" | ||
tag_name: "${{ env.UTC_TIME }}" | ||
prerelease: false | ||
draft: false | ||
generate_release_notes: false | ||
make_latest: true | ||
files: | | ||
/tmp/APPBUNDLES/*.AppBundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
COMPRESSION_OPTS="-l 9 -B5" pelfCreator -m xplshn -n musl_C_Go_Fyne_DevEnv -p "fuse3 build-base libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev linux-headers mesa-dev go git fuse bash" -c |