Build and Release AppBundles #19
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
name: Build and Release Packages | |
on: | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build and Release Packages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/[email protected] | |
# Find and run all build scripts inside ./programs/* | |
- name: Run build scripts for all architectures | |
run: | | |
# Set output directory | |
export OUT_DIR="$HOME/out" | |
mkdir -p "$OUT_DIR" | |
cd ${{ github.workspace }} | |
DBIN_PGRS="dwarfs-tools bwrap-patched" | |
export 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" | |
cd pelf/cmd/pelfd | |
go build -o "$GOBIN/pelfd" | |
cd ../dynexec/lib4bin | |
go build -o "$GOBIN/lib4bin" | |
wget -qO- "https://raw.githubusercontent.com/xplshn/dbin/master/stubdl" | sh -s -- --install "$GOBIN/dbin" add $DBIN_PGRS && \ | |
export PATH="$GOBIN:$PATH" && { | |
ln -sfT "$GOBIN/dwarfs-tools" "$GOBIN/mkdwarfs" | |
ln -sfT "$GOBIN/dwarfs-tools" "$GOBIN/dwarfs" | |
ln -sfT "$GOBIN/bwrap-patched" "$GOBIN/bwrap" | |
} | |
cd "$OUT_DIR" | |
# Check if the recipes directory exists | |
if [ -d "${{ github.workspace }}/recipes" ]; then | |
echo "Listing contents of ./recipes:" | |
ls -l "${{ github.workspace }}/recipes/" | |
# Iterate over build scripts in recipes/* | |
for dir in "${{ github.workspace }}/recipes/"*; do | |
if [ -d "$dir" ]; then | |
for script in "$dir"/*.*sh; do # Target files ending in .sh | |
# Check if the script exists before making it executable | |
if [ -e "$script" ]; then | |
echo "Making $script executable..." | |
chmod +x "$script" | |
echo "Running $script..." | |
"$script" | |
else | |
echo "$script does not exist, skipping." | |
fi | |
done | |
else | |
echo "$dir is not a directory, skipping." | |
fi | |
done | |
else | |
echo "No recipes directory found, skipping." | |
fi | |
# Create GitHub Release | |
- name: Create Release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
title: "Weekly Release - Run ${{ github.run_id }}" | |
automatic_release_tag: weekly-release-${{ github.run_id }} | |
prerelease: false | |
draft: false | |
files: | | |
$OUT_DIR/* | |
repo_token: ${{ secrets.GITHUB_TOKEN }} |