forked from herocode/horus
122 lines
3.9 KiB
YAML
122 lines
3.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
jobs:
|
|
build-release:
|
|
name: Build Release Binaries via hero-git installer
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
IMAGE_NAME: hero-git:latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Ensure hero-git image exists
|
|
run: |
|
|
if ! docker image inspect "$IMAGE_NAME" >/dev/null 2>&1; then
|
|
echo "ERROR: Docker image '$IMAGE_NAME' not found on runner."
|
|
echo "Build it manually on the runner with:"
|
|
echo " docker build -t hero-git:latest -f Dockerfile ."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Prepare bin output dir
|
|
run: mkdir -p hero-bin
|
|
|
|
- name: Run horus_full_install installer in container
|
|
run: |
|
|
docker run --rm \
|
|
-v "$PWD/hero-bin:/root/hero/bin" \
|
|
-e HEROLIB_REF=development_nile_installers \
|
|
"$IMAGE_NAME" \
|
|
bash -lc '
|
|
set -euxo pipefail
|
|
cd /opt/herolib
|
|
pwd
|
|
git rev-parse --abbrev-ref HEAD || true
|
|
./examples/installers/horus/horus_full_install.vsh
|
|
echo "===== AFTER INSTALL, ls -R /root ====="
|
|
ls -R /root || true
|
|
echo "===== AFTER INSTALL, ls -R /root/hero ====="
|
|
ls -R /root/hero || true
|
|
'
|
|
|
|
|
|
- name: Run horus_full_install installer in container
|
|
run: |
|
|
docker run --rm \
|
|
-v "$PWD/hero-bin:/root/hero/bin" \
|
|
-e HEROLIB_REF=development_nile_installers \
|
|
"$IMAGE_NAME" \
|
|
bash -lc "cd /opt/herolib && ./examples/installers/horus/horus_full_install.vsh"
|
|
|
|
- name: List built binaries
|
|
run: ls -al hero-bin
|
|
|
|
- name: Create release directory
|
|
run: mkdir -p release-artifacts
|
|
|
|
- name: Package binaries
|
|
run: |
|
|
for binary in supervisor coordinator horus osiris herorunner runner_osiris runner_sal; do
|
|
if [ -f "hero-bin/$binary" ]; then
|
|
tar -czf "release-artifacts/${binary}-${{ steps.version.outputs.VERSION }}-linux-x86_64.tar.gz" \
|
|
-C hero-bin "$binary"
|
|
echo "Packaged $binary"
|
|
else
|
|
echo "Warning: $binary not found, skipping"
|
|
fi
|
|
done
|
|
|
|
- name: Generate checksums
|
|
run: |
|
|
cd release-artifacts
|
|
sha256sum *.tar.gz > checksums.txt
|
|
cat checksums.txt
|
|
|
|
- name: Create Release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
files: release-artifacts/*
|
|
token: ${{ secrets.TOKEN_GITEA }}
|
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
|
name: Release ${{ steps.version.outputs.VERSION }}
|
|
body: |
|
|
## Horus Release ${{ steps.version.outputs.VERSION }}
|
|
|
|
### Binaries
|
|
Built via the herolib V installer (`horus_full_install.vsh`) inside
|
|
the `hero-git:latest` image and packaged for Linux x86_64:
|
|
- `supervisor`
|
|
- `coordinator`
|
|
- `horus`
|
|
- `osiris`
|
|
- `herorunner`
|
|
- `runner_osiris`
|
|
- `runner_sal`
|
|
|
|
### Installation (example)
|
|
```bash
|
|
wget https://git.ourworld.tf/herocode/horus/releases/download/${{ steps.version.outputs.VERSION }}/supervisor-${{ steps.version.outputs.VERSION }}-linux-x86_64.tar.gz
|
|
tar -xzf supervisor-${{ steps.version.outputs.VERSION }}-linux-x86_64.tar.gz
|
|
chmod +x supervisor
|
|
sudo mv supervisor /usr/local/bin/
|
|
```
|
|
|
|
### Verification
|
|
```bash
|
|
sha256sum -c checksums.txt
|
|
```
|
|
draft: false
|
|
prerelease: false
|