diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2de3864..dcd8156 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -17,22 +17,13 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -47,22 +38,13 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -81,22 +63,13 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -114,22 +87,13 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -150,22 +114,13 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -193,22 +148,13 @@ jobs: runs-on: fedora steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal @@ -238,22 +184,13 @@ jobs: runs-on: alpine steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | apk add --no-cache curl bash @@ -286,22 +223,13 @@ jobs: runs-on: arch steps: - name: Checkout repository - env: - GITEA_TOKEN: ${{ secrets.giteatoken }} run: | set -e - REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" - if [ ! -f "Cargo.toml" ]; then - rm -rf .git 2>/dev/null || true - if [ -n "$GITEA_TOKEN" ]; then - git clone --depth 1 "https://token:${GITEA_TOKEN}@gitea-lxc.moon-dragon.us/echo/linux_patch_api.git" . - else - git clone --depth 1 "$REPO_URL" . - fi - fi - git config --global --add safe.directory "$(pwd)" 2>/dev/null || true - git fetch origin "$GITHUB_SHA" --depth=1 - git checkout -f "$GITHUB_SHA" + REPO_URL="https://gitea-lxc.moon-dragon.us/echo/linux_patch_api/archive/${GITHUB_SHA}.tar.gz" + echo "Downloading archive from $REPO_URL ..." + curl -sfL "$REPO_URL" -o repo.tar.gz + tar -xzf repo.tar.gz --strip-components=1 + rm -f repo.tar.gz - name: Install Rust run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal