fix build
This commit is contained in:
+73
-71
@@ -6,74 +6,76 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: archlinux
|
||||
options: --privileged
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Get Pandora Version
|
||||
id: get_tag
|
||||
run: |
|
||||
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
|
||||
run: |
|
||||
source PKGBUILD
|
||||
echo "current=$pkgver" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Compare Version
|
||||
id: compare
|
||||
run: |
|
||||
if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then
|
||||
echo "build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Update packages
|
||||
run: |
|
||||
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo
|
||||
|
||||
- name: Build Package
|
||||
if: steps.compare.outputs.build == 'true'
|
||||
run: |
|
||||
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }}
|
||||
|
||||
- name: Upload Artefact
|
||||
uses: christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
path: '*.pkg.tar.zst'
|
||||
|
||||
- name: Upload On Gitea Package
|
||||
if: steps.compare.outputs.build == 'true'
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
curl -H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--upload-file *.pkg.tar.zst \
|
||||
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config user.name "Gitea Bot"
|
||||
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
|
||||
echo "No changes to commit"
|
||||
else
|
||||
git commit -m "updpkg: Update to ${{ steps.get_tag.outputs.latest_tag }}"
|
||||
git push origin ${{ gitea.ref }}
|
||||
fi
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: archlinux
|
||||
options: --privileged
|
||||
permissions:
|
||||
packages: write
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Get Pandora Version
|
||||
id: get_tag
|
||||
run: |
|
||||
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
|
||||
run: |
|
||||
source PKGBUILD
|
||||
echo "current=$pkgver" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Compare Version
|
||||
id: compare
|
||||
run: |
|
||||
if [ "${{ steps.get_tag.outputs.latest_tag }}" != "${{ sted -i '/^pkgver=/s/=.*$/='$version'/' PKGBUILDeps.current.outputs.current }}" ]; then
|
||||
echo "build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "build=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Update packages
|
||||
run: |
|
||||
pacman -Syu --noconfirm --noprogressbar --needed base-devel devtools btrfs-progs dbus sudo
|
||||
|
||||
- name: Build Package
|
||||
if: steps.compare.outputs.build == 'true'
|
||||
run: |
|
||||
pkgctl build --pkgver=${{ steps.get_tag.outputs.latest_tag }}
|
||||
|
||||
- name: Upload Artefact
|
||||
uses: christopherHX/gitea-upload-artifact@v4
|
||||
with:
|
||||
path: '*.pkg.tar.zst'
|
||||
|
||||
- name: Upload On Gitea Package
|
||||
if: steps.compare.outputs.build == 'true'
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
run: |
|
||||
curl -H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--upload-file *.pkg.tar.zst \
|
||||
https://git.azur.webhop.me/api/packages/Azur/arch/pandora-arch
|
||||
|
||||
- name: Commit and Push Changes
|
||||
run: |
|
||||
git config user.name "Gitea Bot"
|
||||
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
|
||||
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