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]
|
runs-on: [docker]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
env:
|
||||||
with:
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
fetch-depth: 0 # nécessaire pour les tags et le versioning
|
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
|
- name: Determine version
|
||||||
id: version
|
working-directory: /workspace/repo
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
git checkout master || git checkout -b master origin/master
|
||||||
if git describe --tags --exact-match HEAD 2>/dev/null; then
|
if git describe --tags --exact-match HEAD 2>/dev/null; then
|
||||||
# Le commit actuel est déjà un tag
|
# Le commit actuel est déjà un tag
|
||||||
VERSION=$(git describe --tags --exact-match HEAD | sed 's/^v//')
|
VERSION=$(git describe --tags --exact-match HEAD | sed 's/^v//')
|
||||||
|
|
@ -34,6 +40,7 @@ jobs:
|
||||||
# Créer un tag léger pour cette release
|
# Créer un tag léger pour cette release
|
||||||
git config user.email "ci@geronzi.fr"
|
git config user.email "ci@geronzi.fr"
|
||||||
git config user.name "Forgejo CI"
|
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 tag -a "v${VERSION}" -m "Release v${VERSION}"
|
||||||
git push origin "v${VERSION}" || true
|
git push origin "v${VERSION}" || true
|
||||||
fi
|
fi
|
||||||
|
|
@ -41,17 +48,20 @@ jobs:
|
||||||
echo "Detected version: ${VERSION}"
|
echo "Detected version: ${VERSION}"
|
||||||
|
|
||||||
- name: Update debian changelog
|
- name: Update debian changelog
|
||||||
|
working-directory: /workspace/repo
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ steps.version.outputs.version }}
|
VERSION=${{ steps.version.outputs.version }}
|
||||||
DATE=$(date -R)
|
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
|
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
|
- name: Install build dependencies
|
||||||
|
working-directory: /workspace/repo
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y debhelper dh-python python3-all python3-venv devscripts
|
sudo apt-get install -y debhelper dh-python python3-all python3-venv devscripts
|
||||||
|
|
||||||
- name: Build .deb package
|
- name: Build .deb package
|
||||||
|
working-directory: /workspace/repo
|
||||||
run: |
|
run: |
|
||||||
dpkg-buildpackage -us -uc -b -tc
|
dpkg-buildpackage -us -uc -b -tc
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
@ -60,6 +70,7 @@ jobs:
|
||||||
mv dist/full-updater_*.deb "dist/full-updater_${{ steps.version.outputs.version }}_all.deb"
|
mv dist/full-updater_*.deb "dist/full-updater_${{ steps.version.outputs.version }}_all.deb"
|
||||||
|
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
|
working-directory: /workspace/repo
|
||||||
env:
|
env:
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -84,7 +95,8 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Store artifact
|
- name: Store artifact
|
||||||
|
working-directory: /workspace/repo
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: full-updater-deb
|
name: full-updater-deb
|
||||||
path: dist/*.deb
|
path: /workspace/repo/dist/*.deb
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue