fix build

This commit is contained in:
2026-04-25 10:15:48 +01:00
parent cb80393723
commit f8984cd458
+73 -71
View File
@@ -6,74 +6,76 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
runs-on: ubuntu-latest build:
container: runs-on: ubuntu-latest
image: archlinux container:
options: --privileged image: archlinux
permissions: options: --privileged
packages: write permissions:
contents: write packages: write
steps: contents: write
- name: Checkout repo steps:
uses: actions/checkout@v4 - name: Checkout repo
with: uses: actions/checkout@v4
fetch-depth: 0 with:
token: ${{ secrets.GITEA_TOKEN }} fetch-depth: 0
token: ${{ secrets.GITEA_TOKEN }}
- name: Get Pandora Version
id: get_tag - name: Get Pandora Version
run: | id: get_tag
VERSION=$(git ls-remote --tags --sort='version:refname' https://github.com/Moulberry/PandoraLauncher.git | tail -n 1 | cut -d/ -f3 | sed 's/^v//') run: |
echo "latest_tag=$VERSION" >> $GITHUB_OUTPUT VERSION=$(git ls-remote --tags --sort='version:refname' https://github.com/Moulberry/PandoraLauncher.git | tail -n 1 | cut -d/ -f3 | sed 's/^v//')
echo "latest_tag=$VERSION" >> $GITHUB_OUTPUT
- name: Read Current pkgver
id: current - name: Read Current pkgver
run: | id: current
source PKGBUILD run: |
echo "current=$pkgver" >> $GITHUB_OUTPUT source PKGBUILD
echo "current=$pkgver" >> $GITHUB_OUTPUT
- name: Compare Version
id: compare - name: Compare Version
run: | id: compare
if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then run: |
echo "build=true" >> $GITHUB_OUTPUT if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then
else echo "build=true" >> $GITHUB_OUTPUT
echo "build=false" >> $GITHUB_OUTPUT else
fi echo "build=false" >> $GITHUB_OUTPUT
- name: Update packages fi
run: | - name: Update packages
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo run: |
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo
- name: Build Package
if: steps.compare.outputs.build == 'true' - name: Build Package
run: | if: steps.compare.outputs.build == 'true'
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }} run: |
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }}
- name: Upload Artefact
uses: christopherHX/gitea-upload-artifact@v4 - name: Upload Artefact
with: uses: christopherHX/gitea-upload-artifact@v4
path: '*.pkg.tar.zst' with:
path: '*.pkg.tar.zst'
- name: Upload On Gitea Package
if: steps.compare.outputs.build == 'true' - name: Upload On Gitea Package
env: if: steps.compare.outputs.build == 'true'
TOKEN: ${{ secrets.GITEA_TOKEN }} env:
run: | TOKEN: ${{ secrets.GITEA_TOKEN }}
curl -H "Authorization: token $TOKEN" \ run: |
-H "Content-Type: application/octet-stream" \ curl -H "Authorization: token $TOKEN" \
--upload-file *.pkg.tar.zst \ -H "Content-Type: application/octet-stream" \
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch --upload-file *.pkg.tar.zst \
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch
- name: Commit and Push Changes
run: | - name: Commit and Push Changes
git config user.name "Gitea Bot" run: |
git config user.email "bot@gitea.io" git config user.name "Gitea Bot"
git add -A git config user.email "bot@gitea.io"
git add -A
# On ne commit que s'il y a des changements
if git diff --staged --quiet; then # On ne commit que s'il y a des changements
echo "No changes to commit" if git diff --staged --quiet; then
else echo "No changes to commit"
git commit -m "updpkg: Update to ${{ steps.get_tag.outputs.latest_tag }}" else
git push origin ${{ gitea.ref }} git commit -m "updpkg: Update to ${{ steps.get_tag.outputs.latest_tag }}"
fi git push origin ${{ gitea.ref }}
fi