fix build
This commit is contained in:
+65
-63
@@ -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
|
- name: Get Pandora Version
|
||||||
id: get_tag
|
id: get_tag
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(git ls-remote --tags --sort='version:refname' https://github.com/Moulberry/PandoraLauncher.git | tail -n 1 | cut -d/ -f3 | sed 's/^v//')
|
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
|
echo "latest_tag=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Read Current pkgver
|
- name: Read Current pkgver
|
||||||
id: current
|
id: current
|
||||||
run: |
|
run: |
|
||||||
source PKGBUILD
|
source PKGBUILD
|
||||||
echo "current=$pkgver" >> $GITHUB_OUTPUT
|
echo "current=$pkgver" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Compare Version
|
- name: Compare Version
|
||||||
id: compare
|
id: compare
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then
|
if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then
|
||||||
echo "build=true" >> $GITHUB_OUTPUT
|
echo "build=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "build=false" >> $GITHUB_OUTPUT
|
echo "build=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
- name: Update packages
|
- name: Update packages
|
||||||
run: |
|
run: |
|
||||||
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo
|
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo
|
||||||
|
|
||||||
- name: Build Package
|
- name: Build Package
|
||||||
if: steps.compare.outputs.build == 'true'
|
if: steps.compare.outputs.build == 'true'
|
||||||
run: |
|
run: |
|
||||||
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }}
|
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }}
|
||||||
|
|
||||||
- name: Upload Artefact
|
- name: Upload Artefact
|
||||||
uses: christopherHX/gitea-upload-artifact@v4
|
uses: christopherHX/gitea-upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: '*.pkg.tar.zst'
|
path: '*.pkg.tar.zst'
|
||||||
|
|
||||||
- name: Upload On Gitea Package
|
- name: Upload On Gitea Package
|
||||||
if: steps.compare.outputs.build == 'true'
|
if: steps.compare.outputs.build == 'true'
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
curl -H "Authorization: token $TOKEN" \
|
curl -H "Authorization: token $TOKEN" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
--upload-file *.pkg.tar.zst \
|
--upload-file *.pkg.tar.zst \
|
||||||
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch
|
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch
|
||||||
|
|
||||||
- name: Commit and Push Changes
|
- name: Commit and Push Changes
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Gitea Bot"
|
git config user.name "Gitea Bot"
|
||||||
git config user.email "bot@gitea.io"
|
git config user.email "bot@gitea.io"
|
||||||
git add -A
|
git add -A
|
||||||
|
|
||||||
|
# On ne commit que s'il y a des changements
|
||||||
|
if git diff --staged --quiet; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
else
|
||||||
|
git commit -m "updpkg: Update to ${{ steps.get_tag.outputs.latest_tag }}"
|
||||||
|
git push origin ${{ gitea.ref }}
|
||||||
|
fi
|
||||||
|
|
||||||
# On ne commit que s'il y a des changements
|
|
||||||
if git diff --staged --quiet; then
|
|
||||||
echo "No changes to commit"
|
|
||||||
else
|
|
||||||
git commit -m "updpkg: Update to ${{ steps.get_tag.outputs.latest_tag }}"
|
|
||||||
git push origin ${{ gitea.ref }}
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user