fix(ci): clone from public URL with token, add working-directory to all steps
Some checks failed
Build and Release .deb / build-deb (push) Failing after 2s
Some checks failed
Build and Release .deb / build-deb (push) Failing after 2s
This commit is contained in:
parent
80ddacff16
commit
6f4234942f
1 changed files with 17 additions and 5 deletions
|
|
@ -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 <ci@geronzi.fr> ${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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue