diff --git a/.gitea/workflows/BuildTestPublish.yaml b/.gitea/workflows/BuildTestPublish.yaml new file mode 100644 index 0000000..786f090 --- /dev/null +++ b/.gitea/workflows/BuildTestPublish.yaml @@ -0,0 +1,38 @@ +name: Build-Test-Publish +run-name: Build test and publish all tools + +on: [push] + +defaults: + run: + shell: bash + +jobs: + build: + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm64 + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Gitea + uses: docker/login-action@v3 + with: + registry: gitea.jde.nz + username: DoesntMatter + password: ${{ secrets.DOCKER_PUSH_TOKEN }} + - name: Build + run: | + ./build.sh + - name: Test + run: | + ./test.sh + - name: Publish + run: | + SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} \ + RELEASE_WRITE_TOKEN=${{ secrets.RELEASE_WRITE_TOKEN }} \ + GITEA_CONTAINER_NAME=${{ env.JOB_CONTAINER_NAME }} \ + ./publish.sh diff --git a/install.sh b/install.sh deleted file mode 100755 index ddc7ac0..0000000 --- a/install.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -set -e - -PROJECT="dehydrate" - -# RUN AS ROOT -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root" >&2 - exit 1 -fi - -# 0. see if we were passed a folder to install to -# ----------------------------------------------------------------------------- -INSTALL_DIR="$1" -if [[ -z "$INSTALL_DIR" ]]; then - INSTALL_DIR="/usr/local/bin" -else - if [[ ! -d "$INSTALL_DIR" ]]; then - mkdir -p "$INSTALL_DIR" - fi -fi -echo "Installing $PROJECT to $INSTALL_DIR" - -# 1. Determine architecture -# ----------------------------------------------------------------------------- - -ARCH=$(uname -m) -if [[ "$ARCH" == "x86_64" ]]; then - BIN=$PROJECT.amd64 -elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then - BIN=$PROJECT.arm64 -else - echo "Unsupported architecture: $ARCH" >&2 - exit 1 -fi - -# 3. Download the appropriate binary -# ----------------------------------------------------------------------------- - -URL="https://gitea.jde.nz/public/$PROJECT/releases/download/latest/$BIN" -echo "Downloading $BIN from $URL to $TMPDIR..." - -curl -fsSL -o "$INSTALL_DIR/$PROJECT" "$URL" - -# 4. Make it executable -# ----------------------------------------------------------------------------- -chmod +x "$INSTALL_DIR/$PROJECT" - -# 6. Print success message -# ----------------------------------------------------------------------------- -echo "$PROJECT installed successfully to $INSTALL_DIR/$PROJECT (arch $ARCH)"