From 6f4234942f2aa197eb8f435cac71ccceb6da8ee3 Mon Sep 17 00:00:00 2001 From: enzo Date: Wed, 13 May 2026 00:31:24 +0200 Subject: [PATCH] fix(ci): clone from public URL with token, add working-directory to all steps --- .forgejo/workflows/build.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index d56e32d..649cc96 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -11,14 +11,20 @@ jobs: runs-on: [docker] steps: - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # nécessaire pour les tags et le versioning + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} + run: | + git clone "https://x-access-token:${FORGEJO_TOKEN}@git.geronzi.fr/geronzi/full_updater.git" /workspace/repo + cd /workspace/repo + git fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* || true - name: Determine version - id: version + working-directory: /workspace/repo + env: + FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} run: | set -e + git checkout master || git checkout -b master origin/master if git describe --tags --exact-match HEAD 2>/dev/null; then # Le commit actuel est déjà un tag VERSION=$(git describe --tags --exact-match HEAD | sed 's/^v//') @@ -34,6 +40,7 @@ jobs: # Créer un tag léger pour cette release git config user.email "ci@geronzi.fr" git config user.name "Forgejo CI" + git remote set-url origin "https://x-access-token:${FORGEJO_TOKEN}@git.geronzi.fr/geronzi/full_updater.git" git tag -a "v${VERSION}" -m "Release v${VERSION}" git push origin "v${VERSION}" || true fi @@ -41,17 +48,20 @@ jobs: echo "Detected version: ${VERSION}" - name: Update debian changelog + working-directory: /workspace/repo run: | VERSION=${{ steps.version.outputs.version }} DATE=$(date -R) printf '%s\n' "full-updater (${VERSION}) unstable; urgency=medium" "" " * Auto-built release from commit ${GITHUB_SHA}" "" " -- Forgejo CI ${DATE}" > debian/changelog - name: Install build dependencies + working-directory: /workspace/repo run: | sudo apt-get update sudo apt-get install -y debhelper dh-python python3-all python3-venv devscripts - name: Build .deb package + working-directory: /workspace/repo run: | dpkg-buildpackage -us -uc -b -tc mkdir -p dist @@ -60,6 +70,7 @@ jobs: mv dist/full-updater_*.deb "dist/full-updater_${{ steps.version.outputs.version }}_all.deb" - name: Upload release asset + working-directory: /workspace/repo env: FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} run: | @@ -84,7 +95,8 @@ jobs: fi - name: Store artifact + working-directory: /workspace/repo uses: actions/upload-artifact@v4 with: name: full-updater-deb - path: dist/*.deb + path: /workspace/repo/dist/*.deb